美文网首页
pip安装mysqlclient出现的问题

pip安装mysqlclient出现的问题

作者: 林檎君 | 来源:发表于2018-09-11 16:10 被阅读166次

我的情况是

pipenv install mysqlclient

时候报错

An error occurred while installing mysqlclient==1.3.13!
...
...
...
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
...
...
...

但是似乎

pip install mysqlclient

也会遇到同样的问题

经过很久的搜索终于找到了解决方案

在~/.bashrc 或者 ~/.zshrc 里面添加环境变量

export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
export PATH="/usr/local/opt/openssl/bin:$PATH"
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"

然后source .bashrc

参考:

https://www.jianshu.com/p/d4a349a7e7f5
https://www.jianshu.com/p/c635d239f41c

相关文章

网友评论

      本文标题:pip安装mysqlclient出现的问题

      本文链接:https://www.haomeiwen.com/subject/yfmugftx.html