I can't install pyimgui library on fedora - python

I'm using fedora 36. I tried the install pyimgui python library like its github page.
sudo pip install imgui[full]
But this error occured and I don't know what should I do?
[mehmed-irumi#fedora ~]$ sudo pip install imgui[full]
Collecting imgui[full]
Using cached imgui-1.4.1.tar.gz (855 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting Cython<0.30,>=0.24
Using cached Cython-0.29.32-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (1.9 MB)
Collecting cocos2d
Downloading cocos2d-0.6.9.tar.gz (4.7 MB)
|████████████████████████████████| 4.7 MB 2.6 MB/s
Preparing metadata (setup.py) ... done
Collecting pygame
Downloading pygame-2.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (21.9 MB)
|████████████████████████████████| 21.9 MB 4.0 MB/s
Collecting pyglet
Downloading pyglet-1.5.27-py3-none-any.whl (1.1 MB)
|████████████████████████████████| 1.1 MB 3.0 MB/s
Collecting PySDL2
Downloading PySDL2-0.9.14.tar.gz (761 kB)
|████████████████████████████████| 761 kB 519 kB/s
Preparing metadata (setup.py) ... done
Collecting glfw
Using cached glfw-2.5.5-py2.py27.py3.py30.py31.py32.py33.py34.py35.py36.py37.py38-none-manylinux2014_x86_64.whl (207 kB)
Collecting PyOpenGL
Using cached PyOpenGL-3.1.6-py3-none-any.whl (2.4 MB)
Requirement already satisfied: six>=1.4 in /usr/lib/python3.10/site-packages (from cocos2d->imgui[full]) (1.16.0)
Using legacy 'setup.py install' for cocos2d, since package 'wheel' is not installed.
Using legacy 'setup.py install' for PySDL2, since package 'wheel' is not installed.
Building wheels for collected packages: imgui
Building wheel for imgui (pyproject.toml) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 /usr/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmps2y8h5jz
cwd: /tmp/pip-install-budlaqg2/imgui_ab804ce65070444b94002609ea8c56db
Complete output (39 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.10
creating build/lib.linux-x86_64-3.10/imgui
copying imgui/extra.py -> build/lib.linux-x86_64-3.10/imgui
copying imgui/_compat.py -> build/lib.linux-x86_64-3.10/imgui
copying imgui/__init__.py -> build/lib.linux-x86_64-3.10/imgui
creating build/lib.linux-x86_64-3.10/imgui/integrations
copying imgui/integrations/sdl2.py -> build/lib.linux-x86_64-3.10/imgui/integrations
copying imgui/integrations/pyglet.py -> build/lib.linux-x86_64-3.10/imgui/integrations
copying imgui/integrations/pygame.py -> build/lib.linux-x86_64-3.10/imgui/integrations
copying imgui/integrations/opengl.py -> build/lib.linux-x86_64-3.10/imgui/integrations
copying imgui/integrations/glumpy.py -> build/lib.linux-x86_64-3.10/imgui/integrations
copying imgui/integrations/glfw.py -> build/lib.linux-x86_64-3.10/imgui/integrations
copying imgui/integrations/cocos2d.py -> build/lib.linux-x86_64-3.10/imgui/integrations
copying imgui/integrations/base.py -> build/lib.linux-x86_64-3.10/imgui/integrations
copying imgui/integrations/__init__.py -> build/lib.linux-x86_64-3.10/imgui/integrations
running egg_info
no previously-included directories found matching 'imgui-cpp/examples'
no previously-included directories found matching 'imgui-cpp/extra_fonts'
writing manifest file 'imgui.egg-info/SOURCES.txt'
copying imgui/ansifeed.pxd -> build/lib.linux-x86_64-3.10/imgui
copying imgui/cimgui.pxd -> build/lib.linux-x86_64-3.10/imgui
copying imgui/core.cpp -> build/lib.linux-x86_64-3.10/imgui
copying imgui/core.h -> build/lib.linux-x86_64-3.10/imgui
copying imgui/core.pxd -> build/lib.linux-x86_64-3.10/imgui
copying imgui/core.pyx -> build/lib.linux-x86_64-3.10/imgui
copying imgui/enums.pxd -> build/lib.linux-x86_64-3.10/imgui
running build_ext
creating build/temp.linux-x86_64-3.10
creating build/temp.linux-x86_64-3.10/config-cpp
creating build/temp.linux-x86_64-3.10/imgui-cpp
creating build/temp.linux-x86_64-3.10/imgui
gcc -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPYIMGUI_CUSTOM_EXCEPTION -Iimgui-cpp -Iansifeed-cpp -I./imgui -Iimgui -Iconfig-cpp -I/usr/include/python3.10 -c config-cpp/py_imconfig.cpp -o build/temp.linux-x86_64-3.10/config-cpp/py_imconfig.o -includeconfig-cpp/py_imconfig.h
gcc: fatal error: cannot execute ‘cc1plus’: execvp: No such file or directory
compilation terminated.
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------
ERROR: Failed building wheel for imgui
Failed to build imgui
ERROR: Could not build wheels for imgui, which is required to install pyproject.toml-based projects
[mehmed-irumi#fedora ~]$ sudo pip3 install imgui[full]
Collecting imgui[full]
Using cached imgui-1.4.1.tar.gz (855 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting pyglet
Using cached pyglet-1.5.27-py3-none-any.whl (1.1 MB)
Collecting pygame
Using cached pygame-2.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (21.9 MB)
Collecting PySDL2
Using cached PySDL2-0.9.14.tar.gz (761 kB)
Preparing metadata (setup.py) ... done
Collecting cocos2d
Using cached cocos2d-0.6.9.tar.gz (4.7 MB)
Preparing metadata (setup.py) ... done
Collecting Cython<0.30,>=0.24
Using cached Cython-0.29.32-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (1.9 MB)
Collecting PyOpenGL
Using cached PyOpenGL-3.1.6-py3-none-any.whl (2.4 MB)
Collecting glfw
Using cached glfw-2.5.5-py2.py27.py3.py30.py31.py32.py33.py34.py35.py36.py37.py38-none-manylinux2014_x86_64.whl (207 kB)
Requirement already satisfied: six>=1.4 in /usr/lib/python3.10/site-packages (from cocos2d->imgui[full]) (1.16.0)
Using legacy 'setup.py install' for cocos2d, since package 'wheel' is not installed.
Using legacy 'setup.py install' for PySDL2, since package 'wheel' is not installed.
Building wheels for collected packages: imgui
Building wheel for imgui (pyproject.toml) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 /usr/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmpetpxf412
cwd: /tmp/pip-install-u5lufgjv/imgui_303b3356d2ca4eee89926439e8a62011
Complete output (39 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.10
creating build/lib.linux-x86_64-3.10/imgui
copying imgui/extra.py -> build/lib.linux-x86_64-3.10/imgui
copying imgui/_compat.py -> build/lib.linux-x86_64-3.10/imgui
copying imgui/__init__.py -> build/lib.linux-x86_64-3.10/imgui
creating build/lib.linux-x86_64-3.10/imgui/integrations
copying imgui/integrations/sdl2.py -> build/lib.linux-x86_64-3.10/imgui/integrations
copying imgui/integrations/pyglet.py -> build/lib.linux-x86_64-3.10/imgui/integrations
copying imgui/integrations/pygame.py -> build/lib.linux-x86_64-3.10/imgui/integrations
copying imgui/integrations/opengl.py -> build/lib.linux-x86_64-3.10/imgui/integrations
copying imgui/integrations/glumpy.py -> build/lib.linux-x86_64-3.10/imgui/integrations
copying imgui/integrations/glfw.py -> build/lib.linux-x86_64-3.10/imgui/integrations
copying imgui/integrations/cocos2d.py -> build/lib.linux-x86_64-3.10/imgui/integrations
copying imgui/integrations/base.py -> build/lib.linux-x86_64-3.10/imgui/integrations
copying imgui/integrations/__init__.py -> build/lib.linux-x86_64-3.10/imgui/integrations
running egg_info
no previously-included directories found matching 'imgui-cpp/examples'
no previously-included directories found matching 'imgui-cpp/extra_fonts'
writing manifest file 'imgui.egg-info/SOURCES.txt'
copying imgui/ansifeed.pxd -> build/lib.linux-x86_64-3.10/imgui
copying imgui/cimgui.pxd -> build/lib.linux-x86_64-3.10/imgui
copying imgui/core.cpp -> build/lib.linux-x86_64-3.10/imgui
copying imgui/core.h -> build/lib.linux-x86_64-3.10/imgui
copying imgui/core.pxd -> build/lib.linux-x86_64-3.10/imgui
copying imgui/core.pyx -> build/lib.linux-x86_64-3.10/imgui
copying imgui/enums.pxd -> build/lib.linux-x86_64-3.10/imgui
running build_ext
creating build/temp.linux-x86_64-3.10
creating build/temp.linux-x86_64-3.10/config-cpp
creating build/temp.linux-x86_64-3.10/imgui-cpp
creating build/temp.linux-x86_64-3.10/imgui
gcc -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPYIMGUI_CUSTOM_EXCEPTION -Iimgui-cpp -Iansifeed-cpp -I./imgui -Iimgui -Iconfig-cpp -I/usr/include/python3.10 -c config-cpp/py_imconfig.cpp -o build/temp.linux-x86_64-3.10/config-cpp/py_imconfig.o -includeconfig-cpp/py_imconfig.h
gcc: fatal error: cannot execute ‘cc1plus’: execvp: No such file or directory
compilation terminated.
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------
ERROR: Failed building wheel for imgui
Failed to build imgui
ERROR: Could not build wheels for imgui, which is required to install pyproject.toml-based projects

Because pip would be just about the same on Linux and on Windows, have you tried a virtual environment? Otherwise you might just be using a crappy package, or at the very least it doesn't work on Linux.
For Linux, it's recommended to use virtual environments for developing anyway, since conflicting packages might accrued problems with the base installation, which is detrimental to your Linux system.
EDIT:
Looking at the traceback in more detail, the problem seems to be gcc. Do you know if your current version is compatible with the package.
ANOTHER EDIT: It seems to say things about C++, not just C. Maybe the problem is g++, not gcc?

Related

Why mySQLclient is not installed

I want to install the MySQLclient package on my Cpanel host through the terminal. Because I want to connect my Django project to the database.
When I want to install the necessary packages, everyone installs except MySQLClient.
It also gives an error:
Collecting mysqlclient
Using cached mysqlclient-2.1.0.tar.gz (87 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: mysqlclient
Building wheel for mysqlclient (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [43 lines of output]
mysql_config --version
/bin/mysql_config: line 8: rpm: command not found
['8.0.28']
mysql_config --libs
/bin/mysql_config: line 8: rpm: command not found
['-L/usr/lib64/mysql', '-lmysqlclient', '-lpthread', '-ldl', '-lssl', '-lcrypto', '-lresolv', '-lm', '-lrt']
mysql_config --cflags
/bin/mysql_config: line 8: rpm: command not found
['-I/usr/include/mysql', '-m64']
ext_options:
library_dirs: ['/usr/lib64/mysql']
libraries: ['mysqlclient', 'pthread', 'dl', 'resolv', 'm', 'rt']
extra_compile_args: ['-std=c99', '-m64']
extra_link_args: []
include_dirs: ['/usr/include/mysql']
extra_objects: []
define_macros: [('version_info', "(2,1,0,'final',0)"), ('__version__', '2.1.0')]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.8/MySQLdb
copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-3.8/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.8/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.8/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.8/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-3.8/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-3.8/MySQLdb
creating build/lib.linux-x86_64-3.8/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-3.8/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.8/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.8/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.8/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.8/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.8/MySQLdb/constants
running build_ext
building 'MySQLdb._mysql' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/MySQLdb
/opt/rh/devtoolset-7/root/usr/bin/gcc -Wno-unused-result -Wsign-compare -DNDEBUG -D_GNU_SOURCE -fPIC -fwrapv -O2 -fno-semantic-interposition -pthread -Wno-unused-result -Wsign-compare -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -D_GNU_SOURCE -fPIC -fwrapv -D_GNU_SOURCE -fPIC -fwrapv -O2 -fno-semantic-interposition -pthread -Wno-unused-result -Wsign-compare -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -D_GNU_SOURCE -fPIC -fwrapv -O2 -fno-semantic-interposition -pthread -Wno-unused-result -Wsign-compare -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fPIC -Dversion_info=(2,1,0,'final',0) -D__version__=2.1.0 -I/usr/include/mysql -I/home/hrarshai/virtualenv/filmopia_site/3.8/include/python3.8 -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.8/MySQLdb/_mysql.o -std=c99 -m64
error: command '/opt/rh/devtoolset-7/root/usr/bin/gcc' failed: No such file or directory
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for mysqlclient
Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
error: subprocess-exited-with-error
× Running setup.py install for mysqlclient did not run successfully.
│ exit code: 1
╰─> [45 lines of output]
mysql_config --version
/bin/mysql_config: line 8: rpm: command not found
['8.0.28']
mysql_config --libs
/bin/mysql_config: line 8: rpm: command not found
['-L/usr/lib64/mysql', '-lmysqlclient', '-lpthread', '-ldl', '-lssl', '-lcrypto', '-lresolv', '-lm', '-lrt']
mysql_config --cflags
/bin/mysql_config: line 8: rpm: command not found
['-I/usr/include/mysql', '-m64']
ext_options:
library_dirs: ['/usr/lib64/mysql']
libraries: ['mysqlclient', 'pthread', 'dl', 'resolv', 'm', 'rt']
extra_compile_args: ['-std=c99', '-m64']
extra_link_args: []
include_dirs: ['/usr/include/mysql']
extra_objects: []
define_macros: [('version_info', "(2,1,0,'final',0)"), ('__version__', '2.1.0')]
running install
/home/hrarshai/virtualenv/filmopia_site/3.8/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.8/MySQLdb
copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-3.8/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.8/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.8/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.8/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-3.8/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-3.8/MySQLdb
creating build/lib.linux-x86_64-3.8/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-3.8/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.8/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.8/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.8/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.8/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.8/MySQLdb/constants
running build_ext
building 'MySQLdb._mysql' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/MySQLdb
/opt/rh/devtoolset-7/root/usr/bin/gcc -Wno-unused-result -Wsign-compare -DNDEBUG -D_GNU_SOURCE -fPIC -fwrapv -O2 -fno-semantic-interposition -pthread -Wno-unused-result -Wsign-compare -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -D_GNU_SOURCE -fPIC -fwrapv -D_GNU_SOURCE -fPIC -fwrapv -O2 -fno-semantic-interposition -pthread -Wno-unused-result -Wsign-compare -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -D_GNU_SOURCE -fPIC -fwrapv -O2 -fno-semantic-interposition -pthread -Wno-unused-result -Wsign-compare -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fPIC -Dversion_info=(2,1,0,'final',0) -D__version__=2.1.0 -I/usr/include/mysql -I/home/hrarshai/virtualenv/filmopia_site/3.8/include/python3.8 -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.8/MySQLdb/_mysql.o -std=c99 -m64
error: command '/opt/rh/devtoolset-7/root/usr/bin/gcc' failed: No such file or directory
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> mysqlclient
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
I do not understand this error and I do not know what it says.
No matter how much I searched, I did not find anything useful.
Thank you for your help.
I got the following types of error while installing mysqlclient
error: subprocess-exited-with-error (Running setup.py install for
mysqlclient did not run successfully)
Python Error: Command 'X86_64-Linux-Gnu-Gcc' Failed With Exit Status 1 With Code Examples
Let's solve this problem using the following commands:
sudo apt-get install gcc python3.x-dev # choose correct python version
sudo apt-get install libxml2-dev libxslt1-dev
This solution worked for me and you can at least try it. I hope it helps.
Thank you!
I found out that the host I was trying to install MySQLclient on had to be configured by the provider for Python 3.9
But because I was in a hurry and could not wait for the host to be configured, I ran the project on Python 3.7 and no problem occurred.

Cannot install web3py in Pycharm, linux machine

having problems installing web3 package in Pycharm. I am old and clueless when it comes to package installations. The same errors occur either through pip install or interpreter settings/add package. I do not know what else to try and stackoverflow is giving me an error because it says I need to add more details.
OS: Linux Mint 20.1
Pycharm: 2021.1.3
Python: 3.8.10
This answer worked:
"You have to install apt install python3.8-dev –
furas
"
Collecting web3
Using cached web3-5.28.0-py3-none-any.whl (499 kB)
Collecting eth-utils<2.0.0,>=1.9.5
Using cached eth_utils-1.10.0-py3-none-any.whl (24 kB)
Collecting aiohttp<4,>=3.7.4.post0
Using cached aiohttp-3.8.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.3 MB)
Collecting lru-dict<2.0.0,>=1.1.6
Using cached lru-dict-1.1.7.tar.gz (10 kB)
Preparing metadata (setup.py) ... done
Collecting hexbytes<1.0.0,>=0.1.0
Using cached hexbytes-0.2.2-py3-none-any.whl (6.1 kB)
Requirement already satisfied: requests<3.0.0,>=2.16.0 in /usr/lib/python3/dist-packages (from web3) (2.22.0)
Collecting eth-abi<3.0.0,>=2.0.0b6
Using cached eth_abi-2.1.1-py3-none-any.whl (27 kB)
Collecting ipfshttpclient==0.8.0a2
Using cached ipfshttpclient-0.8.0a2-py3-none-any.whl (82 kB)
Collecting eth-account<0.6.0,>=0.5.7
Using cached eth_account-0.5.7-py3-none-any.whl (101 kB)
Collecting jsonschema<4.0.0,>=3.2.0
Using cached jsonschema-3.2.0-py2.py3-none-any.whl (56 kB)
Collecting protobuf<4,>=3.10.0
Using cached protobuf-3.19.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB)
Collecting eth-hash[pycryptodome]<1.0.0,>=0.2.0
Using cached eth_hash-0.3.2-py3-none-any.whl (8.8 kB)
Collecting eth-typing<3.0.0,>=2.0.0
Using cached eth_typing-2.3.0-py3-none-any.whl (6.2 kB)
Collecting websockets<10,>=9.1
Using cached websockets-9.1-cp38-cp38-manylinux2010_x86_64.whl (102 kB)
Collecting multiaddr>=0.0.7
Using cached multiaddr-0.0.9-py2.py3-none-any.whl (16 kB)
Collecting attrs>=17.3.0
Using cached attrs-21.4.0-py2.py3-none-any.whl (60 kB)
Collecting frozenlist>=1.1.1
Using cached frozenlist-1.3.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (158 kB)
Collecting async-timeout<5.0,>=4.0.0a3
Using cached async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
Collecting yarl<2.0,>=1.0
Using cached yarl-1.7.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (308 kB)
Collecting charset-normalizer<3.0,>=2.0
Using cached charset_normalizer-2.0.12-py3-none-any.whl (39 kB)
Collecting aiosignal>=1.1.2
Using cached aiosignal-1.2.0-py3-none-any.whl (8.2 kB)
Collecting multidict<7.0,>=4.5
Using cached multidict-6.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (121 kB)
Collecting parsimonious<0.9.0,>=0.8.0
Using cached parsimonious-0.8.1-py3-none-any.whl
Collecting eth-rlp<2,>=0.1.2
Using cached eth_rlp-0.3.0-py3-none-any.whl (5.0 kB)
Collecting eth-keys<0.4.0,>=0.3.4
Using cached eth_keys-0.3.4-py3-none-any.whl (21 kB)
Collecting rlp<3,>=1.0.0
Using cached rlp-2.0.1-py2.py3-none-any.whl (20 kB)
Collecting bitarray<1.3.0,>=1.2.1
Using cached bitarray-1.2.2.tar.gz (48 kB)
Preparing metadata (setup.py) ... done
Collecting eth-keyfile<0.6.0,>=0.5.0
Using cached eth_keyfile-0.5.1-py3-none-any.whl (8.3 kB)
Collecting pycryptodome<4,>=3.6.6
Using cached pycryptodome-3.14.1-cp35-abi3-manylinux2010_x86_64.whl (2.0 MB)
Collecting cytoolz<1.0.0,>=0.10.1
Using cached cytoolz-0.11.2.tar.gz (481 kB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: six>=1.11.0 in /usr/lib/python3/dist-packages (from jsonschema<4.0.0,>=3.2.0->web3) (1.14.0)
Collecting pyrsistent>=0.14.0
Using cached pyrsistent-0.18.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (119 kB)
Requirement already satisfied: setuptools in ./venv/lib/python3.8/site-packages (from jsonschema<4.0.0,>=3.2.0->web3) (60.9.3)
Requirement already satisfied: toolz>=0.8.0 in ./venv/lib/python3.8/site-packages (from cytoolz<1.0.0,>=0.10.1->eth-utils<2.0.0,>=1.9.5->web3) (0.11.2)
Collecting eth-rlp<2,>=0.1.2
Using cached eth_rlp-0.2.1-py3-none-any.whl (5.0 kB)
Requirement already satisfied: varint in ./venv/lib/python3.8/site-packages (from multiaddr>=0.0.7->ipfshttpclient==0.8.0a2->web3) (1.0.2)
Collecting base58
Using cached base58-2.1.1-py3-none-any.whl (5.6 kB)
Requirement already satisfied: netaddr in ./venv/lib/python3.8/site-packages (from multiaddr>=0.0.7->ipfshttpclient==0.8.0a2->web3) (0.8.0)
Requirement already satisfied: idna>=2.0 in /usr/lib/python3/dist-packages (from yarl<2.0,>=1.0->aiohttp<4,>=3.7.4.post0->web3) (2.8)
Building wheels for collected packages: lru-dict, bitarray, cytoolz
Building wheel for lru-dict (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
running bdist_wheel
running build
running build_ext
building 'lru' extension
creating build
creating build/temp.linux-x86_64-3.8
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/bs/PycharmProjects/SOLIDITY_TESTING/venv/include -I/usr/include/python3.8 -c lru.c -o build/temp.linux-x86_64-3.8/lru.o
lru.c:1:10: fatal error: Python.h: No such file or directory
1 | #include <Python.h>
| ^~~~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for lru-dict
Running setup.py clean for lru-dict
Building wheel for bitarray (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [20 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/bitarray
copying bitarray/test_bitarray.py -> build/lib.linux-x86_64-3.8/bitarray
copying bitarray/__init__.py -> build/lib.linux-x86_64-3.8/bitarray
copying bitarray/test_util.py -> build/lib.linux-x86_64-3.8/bitarray
copying bitarray/util.py -> build/lib.linux-x86_64-3.8/bitarray
running build_ext
building 'bitarray._bitarray' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/bitarray
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/bs/PycharmProjects/SOLIDITY_TESTING/venv/include -I/usr/include/python3.8 -c bitarray/_bitarray.c -o build/temp.linux-x86_64-3.8/bitarray/_bitarray.o
bitarray/_bitarray.c:12:10: fatal error: Python.h: No such file or directory
12 | #include "Python.h"
| ^~~~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for bitarray
Running setup.py clean for bitarray
Building wheel for cytoolz (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [60 lines of output]
[1/5] Cythonizing cytoolz/utils.pyx
[2/5] Cythonizing cytoolz/dicttoolz.pyx
[3/5] Cythonizing cytoolz/functoolz.pyx
[4/5] Cythonizing cytoolz/itertoolz.pyx
[5/5] Cythonizing cytoolz/recipes.pyx
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/cytoolz
copying cytoolz/_version.py -> build/lib.linux-x86_64-3.8/cytoolz
copying cytoolz/__init__.py -> build/lib.linux-x86_64-3.8/cytoolz
copying cytoolz/_signatures.py -> build/lib.linux-x86_64-3.8/cytoolz
copying cytoolz/compatibility.py -> build/lib.linux-x86_64-3.8/cytoolz
creating build/lib.linux-x86_64-3.8/cytoolz/curried
copying cytoolz/curried/exceptions.py -> build/lib.linux-x86_64-3.8/cytoolz/curried
copying cytoolz/curried/__init__.py -> build/lib.linux-x86_64-3.8/cytoolz/curried
copying cytoolz/curried/operator.py -> build/lib.linux-x86_64-3.8/cytoolz/curried
copying cytoolz/dicttoolz.pyx -> build/lib.linux-x86_64-3.8/cytoolz
copying cytoolz/utils.pyx -> build/lib.linux-x86_64-3.8/cytoolz
copying cytoolz/recipes.pyx -> build/lib.linux-x86_64-3.8/cytoolz
copying cytoolz/itertoolz.pyx -> build/lib.linux-x86_64-3.8/cytoolz
copying cytoolz/functoolz.pyx -> build/lib.linux-x86_64-3.8/cytoolz
copying cytoolz/itertoolz.pxd -> build/lib.linux-x86_64-3.8/cytoolz
copying cytoolz/dicttoolz.pxd -> build/lib.linux-x86_64-3.8/cytoolz
copying cytoolz/utils.pxd -> build/lib.linux-x86_64-3.8/cytoolz
copying cytoolz/recipes.pxd -> build/lib.linux-x86_64-3.8/cytoolz
copying cytoolz/cpython.pxd -> build/lib.linux-x86_64-3.8/cytoolz
copying cytoolz/functoolz.pxd -> build/lib.linux-x86_64-3.8/cytoolz
copying cytoolz/__init__.pxd -> build/lib.linux-x86_64-3.8/cytoolz
creating build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_curried_toolzlike.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_serialization.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_functoolz.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_docstrings.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_recipes.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_dicttoolz.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_curried.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_dev_skip_test.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_utils.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_inspect_args.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_itertoolz.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_compatibility.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_signatures.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_none_safe.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_embedded_sigs.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/dev_skip_test.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_doctests.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
copying cytoolz/tests/test_tlz.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
running build_ext
building 'cytoolz.dicttoolz' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/cytoolz
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/bs/PycharmProjects/SOLIDITY_TESTING/venv/include -I/usr/include/python3.8 -c cytoolz/dicttoolz.c -o build/temp.linux-x86_64-3.8/cytoolz/dicttoolz.o
cytoolz/dicttoolz.c:19:10: fatal error: Python.h: No such file or directory
19 | #include "Python.h"
| ^~~~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for cytoolz
Running setup.py clean for cytoolz
Failed to build lru-dict bitarray cytoolz
Installing collected packages: lru-dict, bitarray, websockets, pyrsistent, pycryptodome, protobuf, parsimonious, multidict, hexbytes, frozenlist, eth-typing, eth-hash, cytoolz, charset-normalizer, base58, attrs, async-timeout, yarl, multiaddr, jsonschema, eth-utils, aiosignal, rlp, ipfshttpclient, eth-keys, eth-abi, aiohttp, eth-rlp, eth-keyfile, eth-account, web3
Running setup.py install for lru-dict ... error
error: subprocess-exited-with-error
× Running setup.py install for lru-dict did not run successfully.
│ exit code: 1
╰─> [14 lines of output]
running install
/home/bs/PycharmProjects/SOLIDITY_TESTING/venv/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_ext
building 'lru' extension
creating build
creating build/temp.linux-x86_64-3.8
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/bs/PycharmProjects/SOLIDITY_TESTING/venv/include -I/usr/include/python3.8 -c lru.c -o build/temp.linux-x86_64-3.8/lru.o
lru.c:1:10: fatal error: Python.h: No such file or directory
1 | #include <Python.h>
| ^~~~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> lru-dict
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
In error you can see
Python.h: No such file or directory
and it means it compiles some C/C++ code and it needs C/C++ headers for Python source code.
You have to install
apt install python3.8-dev

Tensorflow Python 3 Docker Image with mysql failing to install

Note: yes, there are many, many posts regarding the issues of installing mysql for python, specifically for python3 (e.g. Troubles installing mysqlclient with pip3). Most solutions are done in a non-dockerized manner. I have also read the mysqlclient install guide. I am still struggling to get it to work
A repo to clone and test for convenience.
Here I am trying to install it to my docker image.
Dockerfile.ai
FROM tensorflow/tensorflow:1.15.0-gpu-py3-jupyter
# --- Install any needed packages specified in requirements.apt
# from SO answer
# RUN apt-get update && apt-get install -y mysql-client && rm -rf /var/lib/apt
COPY requirements.apt .
RUN apt-get update && xargs apt-get install -y < requirements.apt
# --- Install any needed packages specified in requirements.pip
COPY requirements.pip .
RUN pip install --trusted-host pypi.python.org -r requirements.pip
# activate jupyter extensions
RUN jupyter contrib nbextension install \
&& jupyter nbextension enable codefolding/main \
&& jupyter nbextension enable collapsible_headings/main
docker-compose.yml
version: '3'
services:
tf:
volumes:
- ./notebooks:/tf/notebooks
- ./data:/tf/data
- ./experiments:/tf/experiments
- ./models:/tf/models
ports:
- '8888:8888'
build:
context: .
dockerfile: Dockerfile.ai
volumes:
notebooks:
data:
experiments:
models:
requirements.apt
git
python-pip
mysql-server
python3-dev # from https://pypi.org/project/mysqlclient/
build-essential # from SO solution
default-libmysqlclient-dev # from another SO solution
libmysqlclient-dev
requirements.pip
# This file is used for multiple docker images which may have different bases.
# data related
pymongo
sqlalchemy
# MySQLdb
mysqlclient
# deep learning related
tensorflow-gpu==1.15.0
seaborn
numpy
sacred
requests
pandas
scipy
sklearn
# jupyter
ipykernel
jupyter_contrib_nbextensions
Errors
Requirement already satisfied: more-itertools in /usr/local/lib/python3.6/dist-packages (from zipp>=0.5->importlib-metadata->jsonschema!=2.5.0,>=2.4->nbformat>=4.4->nbconvert>=4.2->jupyter_contrib_nbexten
sions->-r requirements.pip (line 26)) (7.2.0)
Building wheels for collected packages: sqlalchemy, mysqlclient, sacred, sklearn, docopt, py-cpuinfo, jupyter-nbextensions-configurator, pyyaml, jupyter-latex-envs
Building wheel for sqlalchemy (setup.py): started
Building wheel for sqlalchemy (setup.py): finished with status 'done'
Created wheel for sqlalchemy: filename=SQLAlchemy-1.3.12-cp36-cp36m-linux_x86_64.whl size=1216988 sha256=a18ffb30eefe7a430b978e9ae54506ed6fff1197cd8f06f18fc89ab34ffebde1
Stored in directory: /root/.cache/pip/wheels/ee/33/44/0788a6e806866ae2e246d5cd841d07498a46bcb3f3c42ea5a4
Building wheel for mysqlclient (setup.py): started
Building wheel for mysqlclient (setup.py): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-o51hii7f/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-o51hii7f/mysqlclient/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/pip-wheel-fhcie_47 --python-tag cp36
cwd: /tmp/pip-install-o51hii7f/mysqlclient/
Complete output (31 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/compat.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-3.6/MySQLdb
creating build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
running build_ext
building 'MySQLdb._mysql' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/MySQLdb
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Dversion_info=(1,4,6,'final',0) -D__version__=1.4.6 -I/usr/include/mysql -I/usr/include/python3.6m -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.6/MySQLdb/_mysql.o
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/MySQLdb/_mysql.o -lmysqlclient -lpthread -lz -lm -lrt -latomic -lssl -lcrypto -ldl -o build/lib.linux-x86_64-3.6/MySQLdb/_mysql.cpython-36m-x86_64-linux-gnu.so
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for mysqlclient
Running setup.py clean for mysqlclient
Building wheel for sacred (setup.py): started
Building wheel for sacred (setup.py): finished with status 'done'
Created wheel for sacred: filename=sacred-0.8.1-py2.py3-none-any.whl size=109604 sha256=9ae1f0e699ca8ffd5bc83691ac8e40682b045d2277da4bddc9d1c639a031c917
Stored in directory: /root/.cache/pip/wheels/11/a8/f6/1d5f073245cb0a221962713adf81e56c1c9608083f85ecac9b
Building wheel for sklearn (setup.py): started
Building wheel for sklearn (setup.py): finished with status 'done'
Created wheel for sklearn: filename=sklearn-0.0-py2.py3-none-any.whl size=2397 sha256=9b45378895d96c16201b032e0c190415cb91c02dca496e404b4fd3b337c49730
Stored in directory: /root/.cache/pip/wheels/76/03/bb/589d421d27431bcd2c6da284d5f2286c8e3b2ea3cf1594c074
Building wheel for docopt (setup.py): started
Building wheel for docopt (setup.py): finished with status 'done'
Created wheel for docopt: filename=docopt-0.6.2-py2.py3-none-any.whl size=19852 sha256=a8da8458c371b8bb8ec40f3e18a974e505593b9f913f1960578a8e8e90f76101
Stored in directory: /root/.cache/pip/wheels/9b/04/dd/7daf4150b6d9b12949298737de9431a324d4b797ffd63f526e
Building wheel for py-cpuinfo (setup.py): started
Building wheel for py-cpuinfo (setup.py): finished with status 'done'
Created wheel for py-cpuinfo: filename=py_cpuinfo-5.0.0-cp36-none-any.whl size=18912 sha256=cf72494546ffaf64bb66b6c08785c37627a31145d48e03b1a270da64b72c9a55
Stored in directory: /root/.cache/pip/wheels/01/7e/a9/b982d0fea22b7e4ae5619de949570cde5ad55420cec16e86a5
Building wheel for jupyter-nbextensions-configurator (setup.py): started
Building wheel for jupyter-nbextensions-configurator (setup.py): finished with status 'done'
Created wheel for jupyter-nbextensions-configurator: filename=jupyter_nbextensions_configurator-0.4.1-py2.py3-none-any.whl size=466146 sha256=c5ac621237f2bc3174b0ad762dbea00be7688ab71fc72c2eb2d6013c6a759963
Stored in directory: /root/.cache/pip/wheels/15/df/fe/2a74fe34709e7fdc5ae153a768675d9fda93cc7d5133ed1fb0
Building wheel for pyyaml (setup.py): started
Building wheel for pyyaml (setup.py): finished with status 'done'
Created wheel for pyyaml: filename=PyYAML-5.3-cp36-cp36m-linux_x86_64.whl size=45519 sha256=f73f83291978cafd58f9bb245844cd4c4fa44da66839312ebcf777e35e865880
Stored in directory: /root/.cache/pip/wheels/e4/76/4d/a95b8dd7b452b69e8ed4f68b69e1b55e12c9c9624dd962b191
Building wheel for jupyter-latex-envs (setup.py): started
Building wheel for jupyter-latex-envs (setup.py): finished with status 'done'
Created wheel for jupyter-latex-envs: filename=jupyter_latex_envs-1.4.6-py2.py3-none-any.whl size=966916 sha256=84f81480b78b2d1d6db05ce6e6dce61da11482360c3658124c08f9c5f942f791
Stored in directory: /root/.cache/pip/wheels/0d/71/2a/164491997299b9f2479a251e254323fe35d946779e18f27956
Successfully built sqlalchemy sacred sklearn docopt py-cpuinfo jupyter-nbextensions-configurator pyyaml jupyter-latex-envs
Failed to build mysqlclient
Installing collected packages: mag, sil, parpar, pymongo, sqlalchemy, mysqlclient, pytz, pandas, scipy, seaborn, docopt, jsonpickle, munch, py-cpuinfo, colorama, packaging, smmap2, gitdb2, GitPython, sacred, urllib3, chardet, certifi, requests, joblib, scikit-learn, sklearn, jupyter-contrib-core, pyyaml, jupyter-nbextensions-configurator, jupyter-latex-envs, lxml, jupyter-highlight-selected-word, jupyter-contrib-nbextensions
Running setup.py install for mysqlclient: started
Running setup.py install for mysqlclient: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-o51hii7f/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-o51hii7f/mysqlclient/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-record-x870urz9/install-record.txt --single-version-externally-managed --compile
cwd: /tmp/pip-install-o51hii7f/mysqlclient/
Complete output (31 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/compat.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-3.6/MySQLdb
creating build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
running build_ext
building 'MySQLdb._mysql' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/MySQLdb
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Dversion_info=(1,4,6,'final',0) -D__version__=1.4.6 -I/usr/include/mysql -I/usr/include/python3.6m -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.6/MySQLdb/_mysql.o
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/MySQLdb/_mysql.o -lmysqlclient -lpthread -lz -lm -lrt -latomic -lssl -lcrypto -ldl -o build/lib.linux-x86_64-3.6/MySQLdb/_mysql.cpython-36m-x86_64-linux-gnu.so
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-o51hii7f/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-o51hii7f/mysqlclient/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-record-x870urz9/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
ERROR: Service 'tf' failed to build: The command '/bin/bash -c pip install --trusted-host pypi.python.org -r requirements.pip' returned a non-zero code: 1
updates
Found this: https://github.com/postlight/headless-wp-starter/issues/115
and tried adding
# Avoid ERROR: invoke-rc.d: policy-rc.d denied execution of start.
RUN sed -i "s/^exit 101$/exit 0/" /usr/sbin/policy-rc.d
This changed the errors, but fails nonetheless
From "cannot find -lssl; cannot find -lcrypto" when installing mysql-python? it seems you need to install the libssl-dev package through apt

How to install Flask-mysqldb for Python?

I am new to Python and Python-Flask and have ran into an error. I am using Ubuntu 18.04.3 LTS and Python 2.7.15+ to build a python-flask web application.
When installing flask-mysqldb I run into an error.
$ pip install flask-mysqldb
The full output:
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Processing ./.cache/pip/wheels/fd/c9/ef/e0e99dfcf898bc040267e36c4a414ff0b22239968a25161012/Flask_MySQLdb-0.2.0-cp27-none-any.whl
Collecting mysqlclient
Using cached https://files.pythonhosted.org/packages/f8/9b/5db9a03e2088a87c26e3e4d4c7f7e8f4c2dbae610f9521cdfac15755a795/mysqlclient-1.4.5.tar.gz
Requirement already satisfied: Flask>=0.10 in ./.local/lib/python2.7/site-packages (from flask-mysqldb) (1.1.1)
Requirement already satisfied: click>=5.1 in ./.local/lib/python2.7/site-packages (from Flask>=0.10->flask-mysqldb) (7.0)
Requirement already satisfied: Werkzeug>=0.15 in ./.local/lib/python2.7/site-packages (from Flask>=0.10->flask-mysqldb) (0.16.0)
Requirement already satisfied: itsdangerous>=0.24 in ./.local/lib/python2.7/site-packages (from Flask>=0.10->flask-mysqldb) (1.1.0)
Requirement already satisfied: Jinja2>=2.10.1 in ./.local/lib/python2.7/site-packages (from Flask>=0.10->flask-mysqldb) (2.10.3)
Requirement already satisfied: MarkupSafe>=0.23 in ./.local/lib/python2.7/site-packages (from Jinja2>=2.10.1->Flask>=0.10->flask-mysqldb) (1.1.1)
Building wheels for collected packages: mysqlclient
Building wheel for mysqlclient (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-Gno8ny/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-Gno8ny/mysqlclient/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/pip-wheel-OrgtfM --python-tag cp27
cwd: /tmp/pip-install-Gno8ny/mysqlclient/
Complete output (40 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/compat.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
creating build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
running build_ext
building 'MySQLdb._mysql' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/MySQLdb
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-PPrPZj/python2.7-2.7.15=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Dversion_info=(1,4,5,'final',0) -D__version__=1.4.5 -I/usr/include/mysql -I/usr/include/python2.7 -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-2.7/MySQLdb/_mysql.o
MySQLdb/_mysql.c: In function ‘_mysql_field_to_python’:
MySQLdb/_mysql.c:1142:33: warning: passing argument 1 of ‘PyInt_FromString’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
return PyInt_FromString(rowitem, NULL, 10);
^~~~~~~
In file included from /usr/include/python2.7/Python.h:89:0,
from MySQLdb/_mysql.c:38:
/usr/include/python2.7/intobject.h:37:24: note: expected ‘char *’ but argument is of type ‘const char *’
PyAPI_FUNC(PyObject *) PyInt_FromString(char*, char**, int);
^~~~~~~~~~~~~~~~
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-PPrPZj/python2.7-2.7.15=. -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-PPrPZj/python2.7-2.7.15=. -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/MySQLdb/_mysql.o -L/usr/lib/x86_64-linux-gnu -lmysqlclient -lpthread -lz -lm -lrt -latomic -lssl -lcrypto -ldl -o build/lib.linux-x86_64-2.7/MySQLdb/_mysql.so
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for mysqlclient
Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient, flask-mysqldb
Running setup.py install for mysqlclient ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-Gno8ny/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-Gno8ny/mysqlclient/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-record-uh9IqO/install-record.txt --single-version-externally-managed --compile
cwd: /tmp/pip-install-Gno8ny/mysqlclient/
Complete output (40 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/compat.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
creating build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
running build_ext
building 'MySQLdb._mysql' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/MySQLdb
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-PPrPZj/python2.7-2.7.15=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Dversion_info=(1,4,5,'final',0) -D__version__=1.4.5 -I/usr/include/mysql -I/usr/include/python2.7 -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-2.7/MySQLdb/_mysql.o
MySQLdb/_mysql.c: In function ‘_mysql_field_to_python’:
MySQLdb/_mysql.c:1142:33: warning: passing argument 1 of ‘PyInt_FromString’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
return PyInt_FromString(rowitem, NULL, 10);
^~~~~~~
In file included from /usr/include/python2.7/Python.h:89:0,
from MySQLdb/_mysql.c:38:
/usr/include/python2.7/intobject.h:37:24: note: expected ‘char *’ but argument is of type ‘const char *’
PyAPI_FUNC(PyObject *) PyInt_FromString(char*, char**, int);
^~~~~~~~~~~~~~~~
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-PPrPZj/python2.7-2.7.15=. -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-PPrPZj/python2.7-2.7.15=. -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/MySQLdb/_mysql.o -L/usr/lib/x86_64-linux-gnu -lmysqlclient -lpthread -lz -lm -lrt -latomic -lssl -lcrypto -ldl -o build/lib.linux-x86_64-2.7/MySQLdb/_mysql.so
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-Gno8ny/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-Gno8ny/mysqlclient/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-record-uh9IqO/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.`
I have read several other questions and solutions (https://stackoverflow.com/a/51228348/12403455) which suggested using:
mysqlclient‑1.4.5‑cp27‑cp27m‑win_amd64.whl
So I installed this by using:
$ pip install mysqlclient-1.4.5-cp27m-win_amd64.whl
And ran into an error:
Requirement 'mysqlclient‑1.4.5‑cp27‑cp27m‑win_amd64.whl' looks like a filename, but the file does not exist
mysqlclient‑1.4.5‑cp27‑cp27m‑win_amd64.whl is not a valid wheel filename.
I am unsure how to resolve this issue or how to proceed. Any help would be appreciated.
You can not use mysqlclient‑1.4.5‑cp27‑cp27m‑win_amd64.whl as you found in other answer, because that is a wheel for Windows and you are on Linux.
The project mysqlclient, which is a dependency of flask-mysqldb, does not distribute wheels for Linux, so you have to build from source code directly (mysqlclient-1.4.5.tar.gz).
Your install likely fails due to missing build dependencies.
As the project landing page has mentioned, install the build dependencies first:
sudo apt-get install python-dev default-libmysqlclient-dev libssl-dev
Then try again to pip install --user flask-mysqldb.
I followed instructions from this answer
mysql_config not found when installing mysqldb python interface
Just in case I ran
sudo apt-get install mysql-server
later
sudo apt-get install libmysqlclient-dev
and finally
pip3 install flask-mysqldb
and it worked, with Ubuntu 18.04
On Windows 10: pip install flask-mysqldb
This worked for me.

Django MySQLClient pip compile failure on Linux

Django documentation as of v1.8 recommends using mysqlclient connector for the framework. I'm attempting to pip install the package on Ubuntu 14.04 with Python 3.4 and running into a GCC error that I'm unable to find reference to. I'm not an expert on compiling software, so was hoping somebody can see the solution.
I believe I'm getting a linking error. I have installed distro specific mysql headers, but it looked like they were only applicable to Python 2.7.x.
Not sure how much of this is useful so apologies for the long paste, but here's the error log:
Using version 1.3.6 (newest of versions: 1.3.6, 1.3.5, 1.3.4, 1.3.3, 1.3.2, 1.3.1, 1.3.0)
Downloading from URL https://pypi.python.org/packages/source/m/mysqlclient/mysqlclient-1.3.6.tar.gz#md5=58d7c9c617a4286a88db290e7857d3aa (from https://pypi.python.org/simple/mysqlclient/)
Running setup.py (path:/tmp/pycharm-packaging4.tmp/mysqlclient/setup.py) egg_info for package mysqlclient
running egg_info
creating pip-egg-info/mysqlclient.egg-info
writing dependency_links to pip-egg-info/mysqlclient.egg-info/dependency_links.txt
writing top-level names to pip-egg-info/mysqlclient.egg-info/top_level.txt
writing pip-egg-info/mysqlclient.egg-info/PKG-INFO
writing manifest file 'pip-egg-info/mysqlclient.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
reading manifest file 'pip-egg-info/mysqlclient.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pip-egg-info/mysqlclient.egg-info/SOURCES.txt'
Source in /tmp/pycharm-packaging4.tmp/mysqlclient has version 1.3.6, which satisfies requirement mysqlclient
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient
Running command /home/tim/BingVEnv/bin/python -c "import setuptools, tokenize;__file__='/tmp/pycharm-packaging4.tmp/mysqlclient/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-4bp9npvl-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/tim/BingVEnv/include/site/python3.4
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.4
copying _mysql_exceptions.py -> build/lib.linux-x86_64-3.4
creating build/lib.linux-x86_64-3.4/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.4/MySQLdb
copying MySQLdb/compat.py -> build/lib.linux-x86_64-3.4/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.4/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.4/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.4/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-3.4/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-3.4/MySQLdb
creating build/lib.linux-x86_64-3.4/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-3.4/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.4/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.4/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.4/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.4/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-3.4/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.4/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.linux-x86_64-3.4
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -Dversion_info=(1,3,6,'final',1) -D__version__=1.3.6 -I/usr/include/mysql -I/home/tim/BingVEnv/include -I/usr/include/python3.4m -c _mysql.c -o build/temp.linux-x86_64-3.4/_mysql.o -fPIC -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.4/_mysql.o -lmysqlclient -lpthread -lz -lm -ldl -o build/lib.linux-x86_64-3.4/_mysql.cpython-34m.so
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Complete output from command /home/tim/BingVEnv/bin/python -c "import setuptools, tokenize;__file__='/tmp/pycharm-packaging4.tmp/mysqlclient/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-4bp9npvl-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/tim/BingVEnv/include/site/python3.4:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.4
copying _mysql_exceptions.py -> build/lib.linux-x86_64-3.4
creating build/lib.linux-x86_64-3.4/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.4/MySQLdb
copying MySQLdb/compat.py -> build/lib.linux-x86_64-3.4/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.4/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.4/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.4/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-3.4/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-3.4/MySQLdb
creating build/lib.linux-x86_64-3.4/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-3.4/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.4/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.4/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.4/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.4/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-3.4/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.4/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.linux-x86_64-3.4
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -Dversion_info=(1,3,6,'final',1) -D__version__=1.3.6 -I/usr/include/mysql -I/home/tim/BingVEnv/include -I/usr/include/python3.4m -c _mysql.c -o build/temp.linux-x86_64-3.4/_mysql.o -fPIC -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.4/_mysql.o -lmysqlclient -lpthread -lz -lm -ldl -o build/lib.linux-x86_64-3.4/_mysql.cpython-34m.so
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
It looks like you're missing zlib; you'll want to install it: apt-get install zlib1g-dev
I also suggest reading over the README and confirming you have all other dependencies met: https://github.com/dccmx/mysqldb/blob/master/README
Also, I suggest using mysqlclient over MySQLdb as its a fork of MySQLdb and what Django recommends.
using this MySQL Connector worked for me:
https://dev.mysql.com/downloads/connector/python/
https://dev.mysql.com/doc/connector-python/en/connector-python-installation.html
http://dev.mysql.com/doc/connector-python/en/connector-python-django-backend.html

Categories