dan*_*eia 19 homebrew pip virtualenv mysql-python
我在安装mysql-python时遇到问题.创建一个新的virtualenv,并在安装mysql-python时...这里是错误消息:
(env)$ pip install mysql-python
Collecting mysql-python
...
clang -bundle -undefined dynamic_lookup -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk build/temp.macosx-10.12-x86_64-2.7/_mysql.o -L/usr /local/Cellar/mysql/5.7.16/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.12-x86_64-2.7/_mysql.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
Run Code Online (Sandbox Code Playgroud)
使用自制软件,我安装了:
已经尝试brew link但酿造拒绝这样做.
操作系统是MacOS Sierra.
有人可以帮忙吗?谢谢!
小智 28
您可以显式设置ssl库路径.
LDFLAGS=-L/usr/local/opt/openssl/lib pip install mysqlclient
Run Code Online (Sandbox Code Playgroud)
dan*_*eia 12
通过以下步骤解决了这个问题:
brew uninstall mysql
brew install mysql-connector-c
pip install mysql-python
brew unlink mysql-connector-c
brew install mysql
Run Code Online (Sandbox Code Playgroud)
在这里找到答案/sf/answers/1814401431/
不确定这是否正确,但这就是我设法解决它的方法.
als*_*str 10
我尝试更新Xcode的CLT,卸载mysql,检查mysql_config等,但是没有运气。
我发现跑步brew info openssl显示:
...
For compilers to find openssl you may need to set:
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
...
Run Code Online (Sandbox Code Playgroud)
运行这两个命令,然后pip install为我工作(在安装时为我mysqlclient)。
我可以通过运行以下错误进行修复:
pip install -r requirements.txt --global-option=build_ext --global-option="-I/usr/local/opt/openssl/include" --global-option="-L/usr/local/opt/openssl/lib"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9517 次 |
| 最近记录: |