在Mac High Sierra上安装mysqlclient python库不起作用

时间:2018-07-16 00:06:51

标签: mysql django python-3.6 mysql-python macos-high-sierra

我尝试了其他与标题相关的Stack Overflow问题所提出的所有解决方案,但我的问题似乎更具体了。当我尝试安装mysqlclient时显示的错误是此错误:

Error message and code executed before it was displayed

这是显示的错误的代码版本:

Collecting mysqlclient
Using cached https://files.pythonhosted.org/packages/ec/fd/83329b9d3e14f7344d1cb31f128e6dbba70c5975c9e57896815dbb1988ad/mysqlclient-1.3.13.tar.gz
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
Complete output from command /Users/mymac/Documents/chatbot_web_project/virtualenv/bin/python3 -u -c "import setuptools, tokenize;__file__='/private/var/folders/v0/64wkf9q11kn9lg6w1fbcw_dw0000gn/T/pip-install-da0w8w2v/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/v0/64wkf9q11kn9lg6w1fbcw_dw0000gn/T/pip-record-wirofbuy/install-record.txt --single-version-externally-managed --compile --install-headers /Users/mymac/Documents/chatbot_web_project/virtualenv/include/site/python3.6/mysqlclient:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.6-intel-3.6
copying _mysql_exceptions.py -> 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/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
copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.6-intel-3.6/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.macosx-10.6-intel-3.6
/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,3,13,'final',0) -D__version__=1.3.13 -I/usr/local/Cellar/mysql/8.0.11/include/mysql -I/Users/mymac/Documents/chatbot_web_project/virtualenv/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c _mysql.c -o build/temp.macosx-10.6-intel-3.6/_mysql.o
/usr/bin/clang -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-3.6/_mysql.o -L/usr/local/Cellar/mysql/8.0.11/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.6-intel-3.6/_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

----------------------------------------
Command "/Users/mymac/Documents/chatbot_web_project/virtualenv/bin/python3 -u -c "import setuptools, tokenize;__file__='/private/var/folders/v0/64wkf9q11kn9lg6w1fbcw_dw0000gn/T/pip-install-da0w8w2v/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/v0/64wkf9q11kn9lg6w1fbcw_dw0000gn/T/pip-record-wirofbuy/install-record.txt --single-version-externally-managed --compile --install-headers /Users/mymac/Documents/chatbot_web_project/virtualenv/include/site/python3.6/mysqlclient" failed with error code 1 in /private/var/folders/v0/64wkf9q11kn9lg6w1fbcw_dw0000gn/T/pip-install-da0w8w2v/mysqlclient/

正如其他文章所建议的那样,我试图将安装的MYSQL brew库从 mysql-connector-c 更改为 mysql ,但是两者都引发了错误,在安装 mysql 且未安装 mysql-connector-c 时显示。

0 个答案:

没有答案