First i'm developing a django app, when i try to run the server with:
python manage.py runserver 0.0.0.0:8000
The terminal shows:
"django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb"
So, i need to install that package:
(app1)Me% pip install MySQL-python
Errors:
Collecting mysql-python
Using cached MySQL-python-1.2.5.zip
Building wheels for collected packages: mysql-python
Running setup.py bdist_wheel for mysql-python
Complete output from command /Users/GFTecla/Documents/shoutout/bin/python -c "import setuptools;__file__='/private/var/folders/9g/1qrws9yj3wn7lghlrpgyh9cc0000gn/T/pip-build-ZMQOQm/mysql-python/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /var/folders/9g/1qrws9yj3wn7lghlrpgyh9cc0000gn/T/tmp1JfTpfpip-wheel-:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.5-intel-2.7
copying _mysql_exceptions.py -> build/lib.macosx-10.5-intel-2.7
creating build/lib.macosx-10.5-intel-2.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.macosx-10.5-intel-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.5-intel-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.5-intel-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.5-intel-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.5-intel-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.5-intel-2.7/MySQLdb
creating build/lib.macosx-10.5-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.5-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.5-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.5-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.5-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.5-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.5-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.5-intel-2.7/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.macosx-10.5-intel-2.7
gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/Cellar/mysql/5.6.23/include/mysql -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.5-intel-2.7/_mysql.o -g -fno-omit-frame-pointer -fno-strict-aliasing
In file included from _mysql.c:44:
/usr/local/Cellar/mysql/5.6.23/include/mysql/my_config.h:348:11: warning: 'SIZEOF_SIZE_T' macro redefined
#define SIZEOF_SIZE_T SIZEOF_LONG
^
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pymacconfig.h:43:17: note: previous definition is here
# define SIZEOF_SIZE_T 8
^
In file included from _mysql.c:44:
/usr/local/Cellar/mysql/5.6.23/include/mysql/my_config.h:442:9: warning: 'HAVE_WCSCOLL' macro redefined
#define HAVE_WCSCOLL
^
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyconfig.h:911:9: note: previous definition is here
#define HAVE_WCSCOLL 1
^
_mysql.c:1589:10: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
if (how < 0 || how >= sizeof(row_converters)) {
~~~ ^ ~
3 warnings generated.
gcc -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -isysroot / -Qunused-arguments -Qunused-arguments build/temp.macosx-10.5-intel-2.7/_mysql.o -L/usr/local/Cellar/mysql/5.6.23/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.5-intel-2.7/_mysql.so
ld: library not found for -lbundle1.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'gcc' failed with exit status 1
----------------------------------------
Failed building wheel for mysql-python
Failed to build mysql-python
Installing collected packages: mysql-python
Running setup.py install for mysql-python
Complete output from command /Users/GFTecla/Documents/shoutout/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/9g/1qrws9yj3wn7lghlrpgyh9cc0000gn/T/pip-build-ZMQOQm/mysql-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/9g/1qrws9yj3wn7lghlrpgyh9cc0000gn/T/pip-YOrOKA-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/GFTecla/Documents/shoutout/bin/../include/site/python2.7/mysql-python:
running install
running build
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.5-intel-2.7/MySQLdb
running build_ext
building '_mysql' extension
gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/Cellar/mysql/5.6.23/include/mysql -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.5-intel-2.7/_mysql.o -g -fno-omit-frame-pointer -fno-strict-aliasing
In file included from _mysql.c:44:
/usr/local/Cellar/mysql/5.6.23/include/mysql/my_config.h:348:11: warning: 'SIZEOF_SIZE_T' macro redefined
#define SIZEOF_SIZE_T SIZEOF_LONG
^
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pymacconfig.h:43:17: note: previous definition is here
# define SIZEOF_SIZE_T 8
^
In file included from _mysql.c:44:
/usr/local/Cellar/mysql/5.6.23/include/mysql/my_config.h:442:9: warning: 'HAVE_WCSCOLL' macro redefined
#define HAVE_WCSCOLL
^
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyconfig.h:911:9: note: previous definition is here
#define HAVE_WCSCOLL 1
^
_mysql.c:1589:10: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
if (how < 0 || how >= sizeof(row_converters)) {
~~~ ^ ~
3 warnings generated.
gcc -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -isysroot / -Qunused-arguments -Qunused-arguments build/temp.macosx-10.5-intel-2.7/_mysql.o -L/usr/local/Cellar/mysql/5.6.23/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.5-intel-2.7/_mysql.so
ld: library not found for -lbundle1.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/Users/GFTecla/Documents/shoutout/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/9g/1qrws9yj3wn7lghlrpgyh9cc0000gn/T/pip-build-ZMQOQm/mysql-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/9g/1qrws9yj3wn7lghlrpgyh9cc0000gn/T/pip-YOrOKA-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/GFTecla/Documents/shoutout/bin/../include/site/python2.7/mysql-python" failed with error code 1 in /private/var/folders/9g/1qrws9yj3wn7lghlrpgyh9cc0000gn/T/pip-build-ZMQOQm/mysql-python
I have OS X 10.10.2
Django 1.8.2
Python 2.7
The solution was in reinstalling the developer tools:
xcode-select --install
What fixed it for me was:
sudo pip install --upgrade setuptools
Make sure you have mysql installed:
brew install mysql
Based on a solution to a seemingly unrelated problem, I was able to solve the problem here by running brew doctor and cleaning up all the stray header files it called out.
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 working on Mac Catalina with Pyenv with the goal to install apache-airflow[all]. I'm failing and specifically with apache-airflow[mysql]
here is my recipe:
pyenv virtualenv 3.7.4 test
pyenv activate test
pip install --upgrade pip
pip install Cython
pip install 'apache-airflow[mysql]'
pip install 'apache-airflow[all]'
I've tried lots of different stack overflow remedies to install apache-airflow[mysql] including
brew upgrade mysql
brew install mysql-connector-c
How do I install MYSQL client?
How do I install the complete apache airflow on the virtualenv?
here is the error using pyenv virtualenv
(tst) ➜ ~ python -V
Python 3.7.4
(tst) ➜ ~ pip install mysqlclient
Collecting mysqlclient
Using cached https://files.pythonhosted.org/packages/d0/97/7326248ac8d5049968bf4ec708a5d3d4806e412a42e74160d7f266a3e03a/mysqlclient-1.4.6.tar.gz
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
ERROR: Command errored out with exit status 1:
command: /Users/gideonbar/.pyenv/versions/3.7.4/envs/tst/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/t_/ccp4hjg92rzbpjrc4d3cnpm00000gn/T/pip-install-dy9_xr4y/mysqlclient/setup.py'"'"'; __file__='"'"'/private/var/folders/t_/ccp4hjg92rzbpjrc4d3cnpm00000gn/T/pip-install-dy9_xr4y/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/t_/ccp4hjg92rzbpjrc4d3cnpm00000gn/T/pip-record-pdn28c7j/install-record.txt --single-version-externally-managed --compile --install-headers /Users/gideonbar/.pyenv/versions/3.7.4/envs/tst/include/site/python3.7/mysqlclient
cwd: /private/var/folders/t_/ccp4hjg92rzbpjrc4d3cnpm00000gn/T/pip-install-dy9_xr4y/mysqlclient/
Complete output (30 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.15-x86_64-3.7
creating build/lib.macosx-10.15-x86_64-3.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.macosx-10.15-x86_64-3.7/MySQLdb
copying MySQLdb/_exceptions.py -> build/lib.macosx-10.15-x86_64-3.7/MySQLdb
copying MySQLdb/compat.py -> build/lib.macosx-10.15-x86_64-3.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.15-x86_64-3.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.15-x86_64-3.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.15-x86_64-3.7/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.15-x86_64-3.7/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.15-x86_64-3.7/MySQLdb
creating build/lib.macosx-10.15-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.15-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.15-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.15-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.15-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.15-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.15-x86_64-3.7/MySQLdb/constants
running build_ext
building 'MySQLdb._mysql' extension
creating build/temp.macosx-10.15-x86_64-3.7
creating build/temp.macosx-10.15-x86_64-3.7/MySQLdb
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -Dversion_info=(1,4,6,'final',0) -D__version__=1.4.6 -I/usr/local/Cellar/mysql/8.0.18_1/include/mysql -I/Users/gideonbar/.pyenv/versions/3.7.4/envs/tst/include -I/Users/gideonbar/.pyenv/versions/3.7.4/include/python3.7m -c MySQLdb/_mysql.c -o build/temp.macosx-10.15-x86_64-3.7/MySQLdb/_mysql.o
clang -bundle -undefined dynamic_lookup -L/usr/local/opt/readline/lib -L/usr/local/opt/readline/lib -L/Users/gideonbar/.pyenv/versions/3.7.4/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/readline/lib -L/Users/gideonbar/.pyenv/versions/3.7.4/lib build/temp.macosx-10.15-x86_64-3.7/MySQLdb/_mysql.o -L/usr/local/Cellar/mysql/8.0.18_1/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.15-x86_64-3.7/MySQLdb/_mysql.cpython-37m-darwin.so
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/gideonbar/.pyenv/versions/3.7.4/envs/tst/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/t_/ccp4hjg92rzbpjrc4d3cnpm00000gn/T/pip-install-dy9_xr4y/mysqlclient/setup.py'"'"'; __file__='"'"'/private/var/folders/t_/ccp4hjg92rzbpjrc4d3cnpm00000gn/T/pip-install-dy9_xr4y/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/t_/ccp4hjg92rzbpjrc4d3cnpm00000gn/T/pip-record-pdn28c7j/install-record.txt --single-version-externally-managed --compile --install-headers /Users/gideonbar/.pyenv/versions/3.7.4/envs/tst/include/site/python3.7/mysqlclient Check the logs for full command output.
(tst) ➜ ~
I tried following this link
https://github.com/JudgeGirl/Judge-sender/issues/4
brew install mysql # install mysql
brew unlink mysql
brew install mysql-connector-c
# in ~/.zshrc update path and set the mysql bin folder to path
MYSQL_VER=8.0.18_1
export PATH=/usr/local/Cellar/mysql/$MYSQL_VER/bin:$PATH
sudo ln -s /usr/local/Cellar/mysql/$MYSQL_VER/lib/libmysqlclient.21.dylib /usr/local/Cellar/mysql-client/8.0.18/lib/libmysqlclient.21.dylib # create symlink
in terminal:
pyenv activate tst
pip install mysqlclient # install mysql-client finally
If you are getting following error while installing airflow in mac
Invalid active developer path error after upgrading to El Capitan
Try following to fix the dependency
xcode-select --install
To install apache airflow
pip install apache-airflow
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.
I'm unable to 'pip install mysqlclient', and every attempt returns the error: 'ERROR: Failed building wheel for mysqlclient'. For context, I'm running on macOS Mojave 10.14.5. The rest of this post assumes that both 'python==3.6' and 'virtualenv' are already downloaded. In addition, x-code command line tools are already installed (not that I think that matters).
The steps to this are (from command line):
'virtualenv ~/venv'
Output:
Using base prefix '/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6'
New python executable in /Users/usr1/venv/bin/python3.6
Also creating executable in /Users/usr1/venv/bin/python
Installing setuptools, pip, wheel...done."
'source ~/venv/bin/activate'
'pip install mysqlclient'
So far, I've viewed and attempted everything on:
Failed building wheel for mysqlclient
"Failed building wheel for psycopg2" - MacOSX using virtualenv and pip
Failed building wheel for mysql-python
Collecting mysqlclient
Using cached https://files.pythonhosted.org/packages/f4/f1/3bb6f64ca7a429729413e6556b7ba5976df06019a5245a43d36032f1061e/mysqlclient-1.4.2.post1.tar.gz
Building wheels for collected packages: mysqlclient
Building wheel for mysqlclient (setup.py) ... error
ERROR: Complete output from command /Users/usr1/venv/bin/python3.6 -u -c 'import setuptools, tokenize;file='"'"'/private/var/folders/2j/1qt0_7q96lxbxl2w5kx8r1zr0000gn/T/pip-install-4uobjq_4/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/2j/1qt0_7q96lxbxl2w5kx8r1zr0000gn/T/pip-wheel-ehvuw9uv --python-tag cp36:
ERROR: running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.13-x86_64-3.6
creating build/lib.macosx-10.13-x86_64-3.6/MySQLdb
copying MySQLdb/init.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb
copying MySQLdb/_exceptions.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb
copying MySQLdb/compat.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb
creating build/lib.macosx-10.13-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/init.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb/constants
running build_ext
building 'MySQLdb._mysql' extension
creating build/temp.macosx-10.13-x86_64-3.6
creating build/temp.macosx-10.13-x86_64-3.6/MySQLdb
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Dversion_info=(1,4,2,'post',1) -D__version__=1.4.2.post1 -I/usr/local/Cellar/mysql/5.7.19/include/mysql -I/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c MySQLdb/_mysql.c -o build/temp.macosx-10.13-x86_64-3.6/MySQLdb/_mysql.o
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.13-x86_64-3.6/MySQLdb/_mysql.o -L/usr/local/Cellar/mysql/5.7.19/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.13-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 'clang' 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: Complete output from command /Users/usr1/venv/bin/python3.6 -u -c 'import setuptools, tokenize;file='"'"'/private/var/folders/2j/1qt0_7q96lxbxl2w5kx8r1zr0000gn/T/pip-install-4uobjq_4/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/2j/1qt0_7q96lxbxl2w5kx8r1zr0000gn/T/pip-record-zvd4oedq/install-record.txt --single-version-externally-managed --compile --install-headers /Users/usr1/venv/bin/../include/site/python3.6/mysqlclient:
ERROR: running install
running build
running build_py
creating build
creating build/lib.macosx-10.13-x86_64-3.6
creating build/lib.macosx-10.13-x86_64-3.6/MySQLdb
copying MySQLdb/init.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb
copying MySQLdb/_exceptions.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb
copying MySQLdb/compat.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb
creating build/lib.macosx-10.13-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/init.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb/constants
running build_ext
building 'MySQLdb._mysql' extension
creating build/temp.macosx-10.13-x86_64-3.6
creating build/temp.macosx-10.13-x86_64-3.6/MySQLdb
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Dversion_info=(1,4,2,'post',1) -D__version__=1.4.2.post1 -I/usr/local/Cellar/mysql/5.7.19/include/mysql -I/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c MySQLdb/_mysql.c -o build/temp.macosx-10.13-x86_64-3.6/MySQLdb/_mysql.o
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.13-x86_64-3.6/MySQLdb/_mysql.o -L/usr/local/Cellar/mysql/5.7.19/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.13-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 'clang' failed with exit status 1
----------------------------------------
ERROR: Command "/Users/usr1/venv/bin/python3.6 -u -c 'import setuptools, tokenize;file='"'"'/private/var/folders/2j/1qt0_7q96lxbxl2w5kx8r1zr0000gn/T/pip-install-4uobjq_4/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/2j/1qt0_7q96lxbxl2w5kx8r1zr0000gn/T/pip-record-zvd4oedq/install-record.txt --single-version-externally-managed --compile --install-headers /Users/usr1/venv/bin/../include/site/python3.6/mysqlclient" failed with error code 1 in /private/var/folders/2j/1qt0_7q96lxbxl2w5kx8r1zr0000gn/T/pip-install-4uobjq_4/mysqlclient/
CONCLUSION: Ideally, I would like for 'pip' to simply install 'mysqlclient'. I would very much appreciate the help. Thanks in advance.
Only need to install dev version of python with:
sudo apt-get install python3-dev
ERROR: Failed building wheel for mysqlclient
Download mysqlclient.whl from this
Python Extension Package for Windows and install with pip install mysqlclient‑1.4.2‑cp36‑cp36m‑win_amd64.whl
When you are installing the mysqlclient Python library on your computer, you may encounter an error saying Failed building wheel for mysqlclient .
If you are using Debian/ Ubuntu then run the following commands:
sudo apt-get install python3-dev default-libmysqlclient-dev build-essential
If you are using Red Hat/ CentOS then run the following commands:
sudo yum install python3-devel mysql-devel
If the above commands running is finished then try to run this command again on your computer.
pip install mysqlclient
I hope everything works fine as you have expected.
Happy Coding :)