I am new to django
I have created virtual enviroment of python3.6
while installing mysqlclient in virtual environment, it is showing bellow error
(myVirtualEnv) [root#avinash helloWorld]# pip install mysqlclient
Collecting mysqlclient
Using cached https://files.pythonhosted.org/packages/d0/97/7326248ac8d5049968bf4ec708a5d3d4806e412a42e74160d7f266a3e03a/mysqlclient-1.4.6.tar.gz
Building wheels for collected packages: mysqlclient
Building wheel for mysqlclient (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/avinash/pythonProjects/myVirtualEnv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-o154owc4/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-o154owc4/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-vbtdntog --python-tag cp36
cwd: /tmp/pip-install-o154owc4/mysqlclient/
Complete output (30 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
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Dversion_info=(1,4,6,'final',0) -D__version__=1.4.6 -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/include/python3.6m -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.6/MySQLdb/_mysql.o
gcc -pthread -shared -Wl,-z,relro -g build/temp.linux-x86_64-3.6/MySQLdb/_mysql.o -L/usr/lib64/ -L/usr/lib64 -lmariadb -lpython3.6m -o build/lib.linux-x86_64-3.6/MySQLdb/_mysql.cpython-36m-x86_64-linux-gnu.so
/bin/ld: cannot find -lmariadb
collect2: error: ld returned 1 exit status
error: command '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
Running setup.py install for mysqlclient ... error
ERROR: Command errored out with exit status 1:
command: /home/avinash/pythonProjects/myVirtualEnv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-o154owc4/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-o154owc4/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-1pdt4sxo/install-record.txt --single-version-externally-managed --compile --install-headers /home/avinash/pythonProjects/myVirtualEnv/include/site/python3.6/mysqlclient
cwd: /tmp/pip-install-o154owc4/mysqlclient/
Complete output (30 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
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Dversion_info=(1,4,6,'final',0) -D__version__=1.4.6 -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/include/python3.6m -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.6/MySQLdb/_mysql.o
gcc -pthread -shared -Wl,-z,relro -g build/temp.linux-x86_64-3.6/MySQLdb/_mysql.o -L/usr/lib64/ -L/usr/lib64 -lmariadb -lpython3.6m -o build/lib.linux-x86_64-3.6/MySQLdb/_mysql.cpython-36m-x86_64-linux-gnu.so
/bin/ld: cannot find -lmariadb
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/avinash/pythonProjects/myVirtualEnv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-o154owc4/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-o154owc4/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-1pdt4sxo/install-record.txt --single-version-externally-managed --compile --install-headers /home/avinash/pythonProjects/myVirtualEnv/include/site/python3.6/mysqlclient Check the logs for full command output.
I searched for it, did not get any useful information on net
checked below links
Failed building wheel for mysqlclient
"Failed building wheel for psycopg2" - MacOSX using virtualenv and pip
ERROR: Failed building wheel for mysqlclient
Failed building wheel for mysql-python
It is working fine without virtual environment
thanks in advance
My issue has been resolved after installing
MariaDB-shared package in CentOS
yum install MariaDB-shared
Related
I want to use a mysql engine/database with ARA instead of the default sqlite engine that comes with the tool in order to have a more robust engine for multiple entries but I am facing an issue that doesn't allow me to acheive this here below the details :
When i specified mysql engine in the settings.yml file for my ARA server I go the following error :
~/.ara/server # [ara] Using settings file: /root/.ara/server/settings.yaml
Traceback (most recent call last):
File "/root/.local/lib/python3.8/site-packages/ara/server/__main__.py", line 54, in main
import MySQLdb # noqa
ModuleNotFoundError: No module named 'MySQLdb'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/root/.local/bin/ara-manage", line 8, in <module>
sys.exit(main())
File "/root/.local/lib/python3.8/site-packages/ara/server/__main__.py", line 56, in main
raise MissingMysqlclientException from e
ara.setup.exceptions.MissingMysqlclientException: The mysqlclient python library must be installed in order to use the MySQL database engine.
So I checked if mysqlclient is installed and apparently it is not installed :
~/.ara/server # pip3 list installed | grep mysql
But when I try to install it I have this huge exceptions block:
~/.ara/server # pip3.8 install mysqlclient
Collecting mysqlclient
Using cached mysqlclient-2.0.3.tar.gz (88 kB)
Building wheels for collected packages: mysqlclient
Building wheel for mysqlclient (setup.py) ... 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-oq1ay19g/mysqlclient_f0ad3d21508f4b698b4bfb4e7c70b25d/setup.py'"'"'; __file__='"'"'/tmp/pip-install-oq1ay19g/mysqlclient_f0ad3d21508f4b698b4bfb4e7c70b25d/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-lm119tma
cwd: /tmp/pip-install-oq1ay19g/mysqlclient_f0ad3d21508f4b698b4bfb4e7c70b25d/
Complete output (41 lines):
mysql_config --version
['10.5.5']
mysql_config --libs
['-L/usr/lib/', '-lmariadb']
mysql_config --cflags
['-I/usr/include/mysql', '-I/usr/include/mysql/mysql']
ext_options:
library_dirs: ['/usr/lib/']
libraries: ['mariadb']
extra_compile_args: ['-std=c99']
extra_link_args: []
include_dirs: ['/usr/include/mysql', '/usr/include/mysql/mysql']
extra_objects: []
define_macros: [('version_info', "(2,0,3,'final',0)"), ('__version__', '2.0.3')]
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
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fomit-frame-pointer -g -fno-semantic-interposition -fomit-frame-pointer -g -fno-semantic-interposition -fomit-frame-pointer -g -fno-semantic-interposition -DTHREAD_STACK_SIZE=0x100000 -fPIC -Dversion_info=(2,0,3,'final',0) -D__version__=2.0.3 -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/include/python3.8 -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.8/MySQLdb/_mysql.o -std=c99
unable to execute 'gcc': No such file or directory
error: command '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
Running setup.py install for mysqlclient ... 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-oq1ay19g/mysqlclient_f0ad3d21508f4b698b4bfb4e7c70b25d/setup.py'"'"'; __file__='"'"'/tmp/pip-install-oq1ay19g/mysqlclient_f0ad3d21508f4b698b4bfb4e7c70b25d/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-ksqr0pbp/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python3.8/mysqlclient
cwd: /tmp/pip-install-oq1ay19g/mysqlclient_f0ad3d21508f4b698b4bfb4e7c70b25d/
Complete output (41 lines):
mysql_config --version
['10.5.5']
mysql_config --libs
['-L/usr/lib/', '-lmariadb']
mysql_config --cflags
['-I/usr/include/mysql', '-I/usr/include/mysql/mysql']
ext_options:
library_dirs: ['/usr/lib/']
libraries: ['mariadb']
extra_compile_args: ['-std=c99']
extra_link_args: []
include_dirs: ['/usr/include/mysql', '/usr/include/mysql/mysql']
extra_objects: []
define_macros: [('version_info', "(2,0,3,'final',0)"), ('__version__', '2.0.3')]
running install
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
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fomit-frame-pointer -g -fno-semantic-interposition -fomit-frame-pointer -g -fno-semantic-interposition -fomit-frame-pointer -g -fno-semantic-interposition -DTHREAD_STACK_SIZE=0x100000 -fPIC -Dversion_info=(2,0,3,'final',0) -D__version__=2.0.3 -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/include/python3.8 -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.8/MySQLdb/_mysql.o -std=c99
unable to execute 'gcc': No such file or directory
error: command '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-oq1ay19g/mysqlclient_f0ad3d21508f4b698b4bfb4e7c70b25d/setup.py'"'"'; __file__='"'"'/tmp/pip-install-oq1ay19g/mysqlclient_f0ad3d21508f4b698b4bfb4e7c70b25d/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-ksqr0pbp/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python3.8/mysqlclient Check the logs for full command output.
If I understand the error there is a compilation problem due to the abscence of gcc.
But when I try to unstall gcc7 using pip it doesn't work :
~/.ara/server # pip3 install gcc7
ERROR: Could not find a version that satisfies the requirement gcc7
ERROR: No matching distribution found for gcc7
1- So is my analysis right?
2- What could be the real issue behind this? I mean are there other dependencies that might cause this issue.
any help or tip will be greatly appreciated.
P.S: I am working on alpine distribution.
I'm currently trying to install MySQLdb for python2.7 on a RHEL8 server.
When trying to install through pip the module mysql (same output for mysql-python) i receive the following output (the output has changed several times based on my tries, more exactly I had to update gcc, then to install the mysql pkg through yum/dnf, update setuptools through pip as well as through yum/dnf etc.):
Collecting mysql
Using cached https://files.pythonhosted.org/packages/bf/5f/b574ac9f70811df0540e403309f349a8b9fa1a25d3653824c32e52cc1f28/mysql-0.0.2.tar.gz
Collecting MySQL-python (from mysql)
Using cached https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip
Installing collected packages: MySQL-python, mysql
Running setup.py install for MySQL-python ... error
Complete output from command /usr/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-7gpRJR/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-9H4yC_-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying _mysql_exceptions.py -> 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/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/connections.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/CR.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/ER.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.linux-x86_64-2.7
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o
In file included from _mysql.c:44:
/usr/include/mysql/my_config.h:3:2: warning: #warning This file should not be included by clients, include only <mysql.h> [-Wcpp]
#warning This file should not be included by clients, include only <mysql.h>
^~~~~~~
_mysql.c: In function ‘_mysql_ConnectionObject_ping’:
_mysql.c:2005:41: error: ‘MYSQL’ {aka ‘struct st_mysql’} has no member named ‘reconnect’
if ( reconnect != -1 ) self->connection.reconnect = reconnect;
^
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-7gpRJR/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-9H4yC_-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-7gpRJR/MySQL-python/
Currently I have installed through yum the following rpms:
mysql-errmsg-8.0.21-1.module+el8.2.0+7855+47abd494.x86_64
mysql-devel-8.0.21-1.module+el8.2.0+7855+47abd494.x86_64
mysql-common-8.0.21-1.module+el8.2.0+7855+47abd494.x86_64
mysql-8.0.21-1.module+el8.2.0+7855+47abd494.x86_64
mysql-server-8.0.21-1.module+el8.2.0+7855+47abd494.x86_64
mysql-libs-8.0.21-1.module+el8.2.0+7855+47abd494.x86_64
python2-setuptools-39.0.1-12.module+el8.3.0+7075+8484f0d0.noarch
platform-python-pip-9.0.3-18.el8.noarch
python2-libs-2.7.17-2.module+el8.3.0+7681+f1f02ded.x86_64
python2-pip-wheel-9.0.3-18.module+el8.3.0+7707+eb4bba01.noarch
python2-devel-2.7.17-2.module+el8.3.0+7681+f1f02ded.x86_64
Also I have the following modules installed through pip:
setuptools (44.1.1)
mysql-connector-python (8.0.23)
pip (9.0.3)
Any chance you could suggest on what am I missing here?
Thanks in advance!
MySQLdb is too old for your new MySQL. See https://pypi.org/project/MySQL-python/:
MySQL-3.23 through 5.5 … are currently supported
My advice is to try one of the following:
https://pypi.org/project/mysqlclient/
pip install "mysqlclient<2.0"
https://pypi.org/project/mysql-connector-python/
pip install mysql-connector-python
https://pypi.org/project/PyMySQL/
pip install "PyMySQL<1.0"
I'm new to mac, python and django. This will be my second project.
I use to have a django environment working on my old windows pc but, that also came with many weeks of struggle to get it working.
Now I've been struggling through article after article on the web but, with absolutely no progress for 2 weeks.
I just keep getting this issue.....
(klsapp) normancollett#Normans-MacBook-Air klsapp % pip3 install mysqlclient
Collecting mysqlclient
Using cached mysqlclient-1.4.6.tar.gz (85 kB)
Building wheels for collected packages: mysqlclient
Building wheel for mysqlclient (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Users/normancollett/Documents/GitHub/klsapp/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/gy/lrnz57_x27z52f77rgshj80w0000gn/T/pip-install-nkn6549a/mysqlclient/setup.py'"'"'; __file__='"'"'/private/var/folders/gy/lrnz57_x27z52f77rgshj80w0000gn/T/pip-install-nkn6549a/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 /private/var/folders/gy/lrnz57_x27z52f77rgshj80w0000gn/T/pip-wheel-658q_j90
cwd: /private/var/folders/gy/lrnz57_x27z52f77rgshj80w0000gn/T/pip-install-nkn6549a/mysqlclient/
Complete output (30 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.6
creating build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/_exceptions.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/compat.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
creating build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
running build_ext
building 'MySQLdb._mysql' extension
creating build/temp.macosx-10.9-x86_64-3.6
creating build/temp.macosx-10.9-x86_64-3.6/MySQLdb
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -g -Dversion_info=(1,4,6,'final',0) -D__version__=1.4.6 -I/usr/local/Cellar/mysql/8.0.19/include/mysql -I/Users/normancollett/Documents/GitHub/klsapp/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c MySQLdb/_mysql.c -o build/temp.macosx-10.9-x86_64-3.6/MySQLdb/_mysql.o
gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.6/MySQLdb/_mysql.o -L/usr/local/Cellar/mysql/8.0.19/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.9-x86_64-3.6/MySQLdb/_mysql.cpython-36m-darwin.so
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '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
Running setup.py install for mysqlclient ... error
ERROR: Command errored out with exit status 1:
command: /Users/normancollett/Documents/GitHub/klsapp/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/gy/lrnz57_x27z52f77rgshj80w0000gn/T/pip-install-nkn6549a/mysqlclient/setup.py'"'"'; __file__='"'"'/private/var/folders/gy/lrnz57_x27z52f77rgshj80w0000gn/T/pip-install-nkn6549a/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 /private/var/folders/gy/lrnz57_x27z52f77rgshj80w0000gn/T/pip-record-tb3ltsu9/install-record.txt --single-version-externally-managed --compile --install-headers /Users/normancollett/Documents/GitHub/klsapp/include/site/python3.6/mysqlclient
cwd: /private/var/folders/gy/lrnz57_x27z52f77rgshj80w0000gn/T/pip-install-nkn6549a/mysqlclient/
Complete output (30 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.6
creating build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/_exceptions.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/compat.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
creating build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
running build_ext
building 'MySQLdb._mysql' extension
creating build/temp.macosx-10.9-x86_64-3.6
creating build/temp.macosx-10.9-x86_64-3.6/MySQLdb
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -g -Dversion_info=(1,4,6,'final',0) -D__version__=1.4.6 -I/usr/local/Cellar/mysql/8.0.19/include/mysql -I/Users/normancollett/Documents/GitHub/klsapp/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c MySQLdb/_mysql.c -o build/temp.macosx-10.9-x86_64-3.6/MySQLdb/_mysql.o
gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.6/MySQLdb/_mysql.o -L/usr/local/Cellar/mysql/8.0.19/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.9-x86_64-3.6/MySQLdb/_mysql.cpython-36m-darwin.so
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/normancollett/Documents/GitHub/klsapp/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/gy/lrnz57_x27z52f77rgshj80w0000gn/T/pip-install-nkn6549a/mysqlclient/setup.py'"'"'; __file__='"'"'/private/var/folders/gy/lrnz57_x27z52f77rgshj80w0000gn/T/pip-install-nkn6549a/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 /private/var/folders/gy/lrnz57_x27z52f77rgshj80w0000gn/T/pip-record-tb3ltsu9/install-record.txt --single-version-externally-managed --compile --install-headers /Users/normancollett/Documents/GitHub/klsapp/include/site/python3.6/mysqlclient Check the logs for full command output.
(klsapp) normancollett#Normans-MacBook-Air klsapp %
It looks like you do not have an installation of SSL library detected.
First thing you can try is to update your compile toolchain with xcode-select --install.
If this doesn't work, try installing the openssl library:
brew install openssl
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/
Finally, you can try to install your dependencies using the "Conda" package manager; this is the bulkiest but easy method since it will handle all the OpenSSL dependencies and version for you.
May be your python and PIP are incompatible. Please uninstall Python and PIP and try installing freshly.
1) Download and install python3 (Make sure you install 64-bit version)
2) Download https://bootstrap.pypa.io/get-pip.py
3) python3 get-pip.py
4) pip3 install mysqlclient
I managed to resolve this issue by reinstalling python3 via Homebrew.
Uninstall python following this link https://macflypro.com/uninstall-guides/remove-python.html
Then reinstalled by going to terminal using this command:
brew install python3
Then from my venv environment I managed to successfully run:
pip3 install mysqlclient
I have a Django project and I want to deploy it on a server. The project contains a requirements.txt file. Once uploaded to the server, all the packages have been installed except the mysqlclient package. I have tried different alternatives but can't seem to find a solution. Is there a way to install the mysqlclient in Linux?
This is my requirements.txt file:
certifi==2019.9.11
chardet==3.0.4
Django==2.2.6
idna==2.8
imutils==0.5.3
mysqlclient==1.4.6
numpy==1.17.2
opencv-python==4.1.1.26
python-dateutil==2.8.1
pytz==2019.3
six==1.13.0
sqlparse==0.3.0
Note:
I have used Python 3.7.3 and created the project inside a virtual
environment in the Windows system.
I installed Python 3.6.9 in the Linux server with no virtual
environment.
This is the error I am receiving when installing mysqlclient:
Building wheels for collected packages: mysqlclient
Running setup.py bdist_wheel for mysqlclient ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-uzuooif1/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/tmplo_j8asrpip-wheel- --python-tag cp36:
/usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
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
----------------------------------------
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
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-uzuooif1/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-rdhxcu76-record/install-record.txt --single-version-externally-managed --compile:
/usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
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
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-uzuooif1/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-rdhxcu76-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-uzuooif1/mysqlclient/
Does anyone know how to install it properly?
Apparently, this is the solution which worked for me. The errors were:
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
Hence, I just used the command:
sudo apt-get install libssl-dev
And mysqlclient is installed properly.
I was able to solve it due to #Aksr's help.
I'm trying to install mysqlclient inside my env using this command: pip install mysqlclient. I am using pip3 as my default pip environment. My version of pip is 19.2.3. It keeps on throwing this error:
Running setup.py install for mysqlclient ... error
ERROR: Command errored out with exit status 1:
command: /Users/vince/mor_env/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/6p/l2y5y39x0fv2llyxbdyb25g00000gn/T/pip-install-iyew72oj/mysqlclient/setup.py'"'"'; __file__='"'"'/private/var/folders/6p/l2y5y39x0fv2llyxbdyb25g00000gn/T/pip-install-iyew72oj/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 /private/var/folders/6p/l2y5y39x0fv2llyxbdyb25g00000gn/T/pip-record-6oktp750/install-record.txt --single-version-externally-managed --compile --install-headers /Users/vince/mor_env/include/site/python3.6/mysqlclient
cwd: /private/var/folders/6p/l2y5y39x0fv2llyxbdyb25g00000gn/T/pip-install-iyew72oj/mysqlclient/
Complete output (32 lines):
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
running install
running build
running build_py
creating build
creating build/lib.macosx-10.6-intel-3.6
creating build/lib.macosx-10.6-intel-3.6/MySQLdb
copying MySQLdb/__init__.py -> build/lib.macosx-10.6-intel-3.6/MySQLdb
copying MySQLdb/_exceptions.py -> build/lib.macosx-10.6-intel-3.6/MySQLdb
copying MySQLdb/compat.py -> build/lib.macosx-10.6-intel-3.6/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.6-intel-3.6/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.6-intel-3.6/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.6-intel-3.6/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.6-intel-3.6/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.6-intel-3.6/MySQLdb
creating build/lib.macosx-10.6-intel-3.6/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.6-intel-3.6/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.6-intel-3.6/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.6-intel-3.6/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.6-intel-3.6/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.6-intel-3.6/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.6-intel-3.6/MySQLdb/constants
running build_ext
building 'MySQLdb._mysql' extension
creating build/temp.macosx-10.6-intel-3.6
creating build/temp.macosx-10.6-intel-3.6/MySQLdb
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -Dversion_info=(1,4,4,'final',0) -D__version__=1.4.4 -I/usr/local/Cellar/mysql/8.0.13/include/mysql -I/Users/vince/mor_env/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c MySQLdb/_mysql.c -o build/temp.macosx-10.6-intel-3.6/MySQLdb/_mysql.o
/usr/bin/clang -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-3.6/MySQLdb/_mysql.o -L/usr/local/Cellar/mysql/8.0.13/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.6-intel-3.6/MySQLdb/_mysql.cpython-36m-darwin.so
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/clang' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/vince/mor_env/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/6p/l2y5y39x0fv2llyxbdyb25g00000gn/T/pip-install-iyew72oj/mysqlclient/setup.py'"'"'; __file__='"'"'/private/var/folders/6p/l2y5y39x0fv2llyxbdyb25g00000gn/T/pip-install-iyew72oj/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 /private/var/folders/6p/l2y5y39x0fv2llyxbdyb25g00000gn/T/pip-record-6oktp750/install-record.txt --single-version-externally-managed --compile --install-headers /Users/vince/mor_env/include/site/python3.6/mysqlclient Check the logs for full command output.
Solution 1 : Try to upgrade your pip version then install mysqlclient.
Solution 2 : Try to install openssl and then install mysqlclient.