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 :)
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 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'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 getting this error when I'm trying to install flask-mysqldb
Collecting flask-mysqldb Using cached
https://files.pythonhosted.org/packages/62/e3/955c845efe1aacf30c8e2607470544ede36aa1044f6382c809f13e014104/Flask-MySQLdb-0.2.0.tar.gz
Requirement already satisfied: Flask>=0.10 in
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
(from flask-mysqldb) (1.0.2) Collecting mysqlclient (from
flask-mysqldb) Using cached
https://files.pythonhosted.org/packages/f4/f1/3bb6f64ca7a429729413e6556b7ba5976df06019a5245a43d36032f1061e/mysqlclient-1.4.2.post1.tar.gz
Requirement already satisfied: Jinja2>=2.10 in
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
(from Flask>=0.10->flask-mysqldb) (2.10) Requirement already
satisfied: itsdangerous>=0.24 in
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
(from Flask>=0.10->flask-mysqldb) (1.1.0) Requirement already
satisfied: click>=5.1 in
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
(from Flask>=0.10->flask-mysqldb) (7.0) Requirement already satisfied:
Werkzeug>=0.14 in
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
(from Flask>=0.10->flask-mysqldb) (0.14.1) Requirement already
satisfied: MarkupSafe>=0.23 in
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
(from Jinja2>=2.10->Flask>=0.10->flask-mysqldb) (1.1.1) Installing
collected packages: mysqlclient, flask-mysqldb Running setup.py
install for mysqlclient ... error
Complete output from command /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c
"import setuptools,
tokenize;__file__='/private/var/folders/b_/wz97t8ts7dg9lnj91y61p5rh0000gn/T/pip-install-56xxcsr1/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/b_/wz97t8ts7dg9lnj91y61p5rh0000gn/T/pip-record-113i8svg/install-record.txt
--single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.7
creating build/lib.macosx-10.9-x86_64-3.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb
copying MySQLdb/_exceptions.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb
copying MySQLdb/compat.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb
creating build/lib.macosx-10.9-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb/constants
running build_ext
building 'MySQLdb._mysql' extension
creating build/temp.macosx-10.9-x86_64-3.7
creating build/temp.macosx-10.9-x86_64-3.7/MySQLdb
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -Dversion_info=(1,4,2,'post',1) -D__version__=1.4.2.post1 -I/usr/local/Cellar/mysql/8.0.16/include/mysql -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c MySQLdb/_mysql.c -o build/temp.macosx-10.9-x86_64-3.7/MySQLdb/_mysql.o
gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.7/MySQLdb/_mysql.o
-L/usr/local/Cellar/mysql/8.0.16/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.9-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 'gcc' failed with exit status 1
----------------------------------------
Command
"/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c
"import setuptools,
tokenize;__file__='/private/var/folders/b_/wz97t8ts7dg9lnj91y61p5rh0000gn/T/pip-install-56xxcsr1/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/b_/wz97t8ts7dg9lnj91y61p5rh0000gn/T/pip-record-113i8svg/install-record.txt
--single-version-externally-managed --compile" failed with error code 1 in
/private/var/folders/b_/wz97t8ts7dg9lnj91y61p5rh0000gn/T/pip-install-56xxcsr1/mysqlclient/
If you have installed pip ( if not use $sudo easy_install pip) and then in the terminal use the command $conda install -c bioconda mysqlclient (considering the fact that you have anaconda installed) then run this command $pip install flask-mysqldb
If anaconda is not installed simply try $pip install flask-mysqldb but not sure of this
I am trying to install mysqlclient on Mac OSX, as required by Django to use MySql rather than sqlite DB.
I originally tried pip3 install mysqlclient but I was getting an error like this:
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/3f/1z_bg4h52lz8n0_gc1mp7gwh0000gn/T/pip-install-em4vq6dr/mysqlclient/
I have done a lot of Googling and tried so many suggestions (this appears a common issue), and I've ended up with even more of a mess of an error message now:
Collecting mysqlclient==1.3.1
Downloading https://files.pythonhosted.org/packages/6b/ba/4729d99e85a0a35bb46d55500570de05b4af10431cef174b6da9f58a0e50/mysqlclient-1.3.1.tar.gz (76kB)
100% |████████████████████████████████| 81kB 2.0MB/s
Building wheels for collected packages: mysqlclient
Building wheel for mysqlclient (setup.py) ... error
Complete output from command /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/z_/k_j3hrx10gn5w244fpvzw01r0000gn/T/pip-install-4nhdinpy/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/z_/k_j3hrx10gn5w244fpvzw01r0000gn/T/pip-wheel-41536ku7 --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.6
copying _mysql_exceptions.py -> 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/compat.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/connections.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/CR.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/ER.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
copying MySQLdb/constants/REFRESH.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
running build_ext
building '_mysql' extension
creating build/temp.macosx-10.9-x86_64-3.6
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -Dversion_info=(1,3,1,'final',1) -D__version__=1.3.1 -I/usr/local/Cellar/mysql/8.0.15/include/mysql -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c _mysql.c -o build/temp.macosx-10.9-x86_64-3.6/_mysql.o
_mysql.c:40:10: fatal error: 'my_config.h' file not found
#include "my_config.h"
^~~~~~~~~~~~~
1 error generated.
error: command '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 /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/z_/k_j3hrx10gn5w244fpvzw01r0000gn/T/pip-install-4nhdinpy/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/z_/k_j3hrx10gn5w244fpvzw01r0000gn/T/pip-record-o9decnbp/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.6
copying _mysql_exceptions.py -> 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/compat.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/connections.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/CR.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/ER.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
copying MySQLdb/constants/REFRESH.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
running build_ext
building '_mysql' extension
creating build/temp.macosx-10.9-x86_64-3.6
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -Dversion_info=(1,3,1,'final',1) -D__version__=1.3.1 -I/usr/local/Cellar/mysql/8.0.15/include/mysql -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c _mysql.c -o build/temp.macosx-10.9-x86_64-3.6/_mysql.o
_mysql.c:40:10: fatal error: 'my_config.h' file not found
#include "my_config.h"
^~~~~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/z_/k_j3hrx10gn5w244fpvzw01r0000gn/T/pip-install-4nhdinpy/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/z_/k_j3hrx10gn5w244fpvzw01r0000gn/T/pip-record-o9decnbp/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/z_/k_j3hrx10gn5w244fpvzw01r0000gn/T/pip-install-4nhdinpy/mysqlclient/
Anybody have any suggestions as to where I'm going wrong?
Using Python 3.6
Thanks
Chris
Have fixed it based on this post - https://github.com/PyMySQL/mysqlclient-python/issues/169#issuecomment-306821834 - but I only did this bit:
ran brew info openssl
than entered the following as two separate commands
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
Then:
pip3 install mysqlclient
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) ... done
Stored in directory: /Users/chris/Library/Caches/pip/wheels/30/91/e0/2ee952bce05b1247807405c6710c6130e49468a5240ae27134
Successfully built mysqlclient
Installing collected packages: mysqlclient
Successfully installed mysqlclient-1.4.2.post1