MySQLClient instal error: “raise Exception(”Wrong MySQL configuration: maybe https://bugs.mysql.com/
ERROR: Command errored out with exit status 1:
?? ? command: /Library/Frameworks/Python.framework/Versions/3.6/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/wz/n9gx1sqj3475nnqnvz4zzy9m0000gn/T/pip-install-vnx2mp28/mysqlclient/setup.py'"'"'; __file__='"'"'/private/var/folders/wz/n9gx1sqj3475nnqnvz4zzy9m0000gn/T/pip-install-vnx2mp28/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
?? ? ? ? cwd: /private/var/folders/wz/n9gx1sqj3475nnqnvz4zzy9m0000gn/T/pip-install-vnx2mp28/mysqlclient/
? ? Complete output (11 lines):
? ? Traceback (most recent call last):
? ? ? File "<string>", line 1, in <module>
? ? ? File "/private/var/folders/wz/n9gx1sqj3475nnqnvz4zzy9m0000gn/T/pip-install-vnx2mp28/mysqlclient/setup.py", line 16, in <module>
? ? ? ? metadata, options = get_config()
? ? ? File "/private/var/folders/wz/n9gx1sqj3475nnqnvz4zzy9m0000gn/T/pip-install-vnx2mp28/mysqlclient/setup_posix.py", line 63, in get_config
? ? ? ? libraries = [dequote(i[2:]) for i in libs if i.startswith('-l')]
? ? ? File "/private/var/folders/wz/n9gx1sqj3475nnqnvz4zzy9m0000gn/T/pip-install-vnx2mp28/mysqlclient/setup_posix.py", line 63, in <listcomp>
? ? ? ? libraries = [dequote(i[2:]) for i in libs if i.startswith('-l')]
? ? ? File "/private/var/folders/wz/n9gx1sqj3475nnqnvz4zzy9m0000gn/T/pip-install-vnx2mp28/mysqlclient/setup_posix.py", line 12, in dequote
? ? ? ? raise Exception("Wrong MySQL configuration: maybe https://bugs.mysql.com/bug.php?id=86971 ?")
? ? Exception: Wrong MySQL configuration: maybe https://bugs.mysql.com/bug.php?id=86971 ?
? ? ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output
?
解決方案:
# 修改前先備份
?
cp ?mysql_config mysql_config_backup
# 修改編輯權(quán)限
chmod 777 mysql_config
vi mysql_config
# 修改114行
> # Create options?
> libs="-L$pkglibdir"
> libs="$libs -l "
# 修改為
> # Create options?
> libs="-L$pkglibdir"
> libs="$libs -lmysqlclient -lssl -lcrypto"
?
然后:
新建:touch ~/.bash_profileopen ~/.bash_profile打開文件之后把下面貼在該文件末尾:
export PATH="/usr/local/opt/openssl/bin:$PATH" export LDFLAGS="-L/usr/local/opt/openssl/lib" export CPPFLAGS="-I/usr/local/opt/openssl/include"然后保存,保存之后source ~/.bash_profile
然后再安裝 ?pip3 install mysqlclient就成功啦
總結(jié)
以上是生活随笔為你收集整理的MySQLClient instal error: “raise Exception(”Wrong MySQL configuration: maybe https://bugs.mysql.com/的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 基于TCP的在线英文词典(使用了sqli
- 下一篇: 前端第一天 基础