在Mac OS 10.14.1上安装MySQL-Python时出现问题 [英] Problem installing MySQL-Python on Mac OS 10.14.1

查看:122
本文介绍了在Mac OS 10.14.1上安装MySQL-Python时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近升级到Mac OS Mojave,现在无法安装MySQL-Python:

I recently upgraded to Mac OS Mojave and now can't install MySQL-Python:

pip install MySQL-Python

...
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.13-x86_64-2.7/_mysql.o -L/usr/local/opt/mysql-client/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.13-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

堆栈跟踪显示未找到"ssl"库.我不确定这是什么意思,因为我已经安装了最新的XCode和OpenSSL.任何建议表示赞赏.

The stack trace says that the "ssl" library wasn't found. I'm not sure what that means though as I have the latest XCode and OpenSSL is installed. Any advice appreciated.

推荐答案

我在MacOS 10.14上遇到了同样的问题,并且可以通过以下步骤解决它:

I had the same issue on MacOS 10.14, and I was able to solve it using these steps:

/usr/local的权限更改为允许Homebrew创建链接:

sudo chown -R $(whoami) $(brew --prefix)/*

现在已修复权限,重新安装openssl:

Re-install openssl now that permissions have been fixed:

brew reinstall openssl

运行以下两个命令以允许编译器找到openssl:

Run these two commands to allow compilers to find openssl:

export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"

然后,再次尝试安装MySQL-Python:

Then, try again to install MySQL-Python:

pip install MySQL-Python

这篇关于在Mac OS 10.14.1上安装MySQL-Python时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆