Skip to content

"MySQL-python pip package" falls over in debian 9 #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
toolagio opened this issue Oct 3, 2018 · 3 comments
Open

"MySQL-python pip package" falls over in debian 9 #4

toolagio opened this issue Oct 3, 2018 · 3 comments

Comments

@toolagio
Copy link

toolagio commented Oct 3, 2018

I'm an ansible newbie, but I get the following at this step:

failed: [xxxxxxxxxxxx] (item=MySQL-python) => {"changed": false, "cmd": "/usr/bin/pip2 install MySQL-python", "item": "MySQL-python", "msg": "stdout: Collecting MySQL-python\n Using cached https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip\n Complete output from command python setup.py egg_info:\n Traceback (most recent call last):\n File "", line 1, in \n ImportError: No module named setuptools\n \n ----------------------------------------\n\n:stderr: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-tCMPSV/MySQL-python/\n"}

@tschifftner
Copy link
Owner

Hello,

it looks like you have missing dependencies

ImportError: No module named setuptools

You might be able to solve it by installing the required package

sudo apt-get install python-setuptools

@toolagio
Copy link
Author

toolagio commented Oct 4, 2018

Hello.
Thanks for reviewing.
What's the best way to incorporate these dependencies into the playbook?

And after install both python-setuptools and python-wheel, I'm still getting:

failed: [orf-dev.it.ox.ac.uk] (item=MySQL-python) => {"changed": false, "cmd": "/usr/bin/pip2 install MySQL-python", "item": "MySQL-python", "msg": "stdout: Collecting MySQL-python\n Using cached https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip\nBuilding wheels for collected packages: MySQL-python\n Running setup.py bdist_wheel for MySQL-python: started\n Running setup.py bdist_wheel for MySQL-python: finished with status 'error'\n Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-RdIW05/MySQL-python/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /tmp/tmpcq_Oqfpip-wheel- --python-tag cp27:\n running bdist_wheel\n running build\n running build_py\n creating build\n creating build/lib.linux-x86_64-2.7\n copying mysql_exceptions.py -> build/lib.linux-x86_64-2.7\n creating build/lib.linux-x86_64-2.7/MySQLdb\n copying MySQLdb/init.py -> build/lib.linux-x86_64-2.7/MySQLdb\n copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb\n copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb\n copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb\n copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb\n copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb\n creating build/lib.linux-x86_64-2.7/MySQLdb/constants\n copying MySQLdb/constants/init.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants\n copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants\n copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants\n copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants\n copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants\n copying MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants\n copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants\n running build_ext\n building 'mysql' extension\n creating build/temp.linux-x86_64-2.7\n x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Dversion_info=(1,2,5,'final',1) -D__version=1.2.5 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o\n unable to execute 'x86_64-linux-gnu-gcc': No such file or directory\n error: command 'x86_64-linux-gnu-gcc' failed with exit status 1\n \n ----------------------------------------\n Running setup.py clean for MySQL-python\nFailed to build MySQL-python\nInstalling collected packages: MySQL-python\n Running setup.py install for MySQL-python: started\n Running setup.py install for MySQL-python: finished with status 'error'\n Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-RdIW05/MySQL-python/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-O4BUK0-record/install-record.txt --single-version-externally-managed --compile:\n running install\n running build\n running build_py\n creating build\n creating build/lib.linux-x86_64-2.7\n copying mysql_exceptions.py -> build/lib.linux-x86_64-2.7\n creating build/lib.linux-x86_64-2.7/MySQLdb\n copying MySQLdb/init.py -> build/lib.linux-x86_64-2.7/MySQLdb\n copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb\n copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb\n copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb\n copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb\n copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb\n creating build/lib.linux-x86_64-2.7/MySQLdb/constants\n copying MySQLdb/constants/init.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants\n copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants\n copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants\n copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants\n copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants\n copying MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants\n copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants\n running build_ext\n building 'mysql' extension\n creating build/temp.linux-x86_64-2.7\n x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Dversion_info=(1,2,5,'final',1) -D__version=1.2.5 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o\n unable to execute 'x86_64-linux-gnu-gcc': No such file or directory\n error: command 'x86_64-linux-gnu-gcc' failed with exit status 1\n \n ----------------------------------------\n\n:stderr: Failed building wheel for MySQL-python\nCommand "/usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-RdIW05/MySQL-python/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-O4BUK0-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-RdIW05/MySQL-python/\n"}

Any recommendations?

@L1ghtman2k
Copy link

L1ghtman2k commented Nov 27, 2019

I know this is kind of late, but if someone else experiences this, try:
apt update -y

apt install python-dev build-essential libssl-dev libffi-dev libxml2-dev libxslt1-dev zlib1g-dev -y

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants