我是 python 编程新手,在安装模块时遇到一些困难。我已经在 mac 上安装了用于 python 的 mysql 连接器,并且工作得很好。现在我尝试在 mac 上安装 qpid proton http://qpid.apache.org/proton/ 。
Qpid没有像mysql那样的安装程序,所以我必须手动安装它。文档确实缺乏。我已经搜索过,但是这里描述的 easy_install 或 pip 似乎不适合我。 What is the most compatible way to install python modules on a Mac?
“PIP install proton”仅安装库的一部分,如此处所述 https://pypi.python.org/pypi/python-qpid-proton/0.8.2
如何在 Mac 上安装此库?
最佳答案
如果你仍然关心 python-qpid-proton 现在在 pypi 上:https://pypi.python.org/pypi/python-qpid-proton
所以只要运行
pip install python-qpid-proton
在 Mac 上,您在安装过程中可能会遇到找不到 openssl 库的问题。 先使用brew安装openssl:
brew install openssl
然后brew给出提示:
Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include
PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig
因此,只需导出这些环境变量并重新运行您最喜欢的 pip install (或者更好地避免将来发生严重破坏,将以下内容添加到您的 ~/.bash_profile 中:
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"
这对我来说就像一个魅力!
关于python - 在 mac osx 上安装 python 模块 (qpid proton),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30162430/