Can not install mysql on pycharm

Collecting mysql
Using cached https://files.pythonhosted.org/packages/bf/5f/b574ac9f70811df0540e403309f349a8b9fa1a25d3653824c32e52cc1f28/mysql-0.0.2.tar.gz
Collecting mysqlclient (from mysql)
Using cached https://files.pythonhosted.org/packages/13/37/6c941aabeb78464a538b7d43266bfae645993779e3ca3e12fe82b4590f52/mysqlclient-1.4.3.tar.gz
Installing collected packages: mysqlclient, mysql
Running setup.py install for mysqlclient: started
Running setup.py install for mysqlclient: finished with status 'error'
Complete output from command /Users/mac/PycharmProjects/untitled/venv/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/6r/my6095mj09l5y9f4x3xt3w_h0000gn/T/pycharm-packaging/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/6r/my6095mj09l5y9f4x3xt3w_h0000gn/T/pip-record-nlq_zeti/install-record.txt --single-version-externally-managed --compile --install-headers /Users/mac/PycharmProjects/untitled/venv/include/site/python3.7/mysqlclient:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.6-intel-3.7
creating build/lib.macosx-10.6-intel-3.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.macosx-10.6-intel-3.7/MySQLdb
copying MySQLdb/_exceptions.py -> build/lib.macosx-10.6-intel-3.7/MySQLdb
copying MySQLdb/compat.py -> build/lib.macosx-10.6-intel-3.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.6-intel-3.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.6-intel-3.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.6-intel-3.7/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.6-intel-3.7/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.6-intel-3.7/MySQLdb
creating build/lib.macosx-10.6-intel-3.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.6-intel-3.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.6-intel-3.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.6-intel-3.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.6-intel-3.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.6-intel-3.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.6-intel-3.7/MySQLdb/constants
warning: build_py: byte-compiling is disabled, skipping.

running build_ext
building 'MySQLdb._mysql' extension
creating build/temp.macosx-10.6-intel-3.7
creating build/temp.macosx-10.6-intel-3.7/MySQLdb
gcc -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -Dversion_info=(1,4,3,'final',0) -D__version__=1.4.3 -I/usr/local/Cellar/mysql/8.0.17/include/mysql -I/Users/mac/PycharmProjects/untitled/venv/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c MySQLdb/_mysql.c -o build/temp.macosx-10.6-intel-3.7/MySQLdb/_mysql.o
gcc -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-3.7/MySQLdb/_mysql.o -L/usr/local/Cellar/mysql/8.0.17/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.6-intel-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 "/Users/mac/PycharmProjects/untitled/venv/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/6r/my6095mj09l5y9f4x3xt3w_h0000gn/T/pycharm-packaging/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/6r/my6095mj09l5y9f4x3xt3w_h0000gn/T/pip-record-nlq_zeti/install-record.txt --single-version-externally-managed --compile --install-headers /Users/mac/PycharmProjects/untitled/venv/include/site/python3.7/mysqlclient" failed with error code 1 in /private/var/folders/6r/my6095mj09l5y9f4x3xt3w_h0000gn/T/pycharm-packaging/mysqlclient/

1 comment
Comment actions Permalink

Hi,

When do you get this error? Are you installing mysql from PyCharm's UI?

The issue is most likely has to do with compiling the package and is not related to IDE. Please try to install it from the terminal outside of IDE.

0

Please sign in to leave a comment.