【问题标题】:Install python module on mac osx (qpid proton)在 mac osx (qpid proton) 上安装 python 模块
【发布时间】:2017-01-16 12:55:58
【问题描述】:

我是 python 编程的新手,在安装模块时遇到了一些困难。我已经在 mac 上安装了用于 python 的 mysql 连接器,效果很好。现在我试图在 mac http://qpid.apache.org/proton/ 上安装 qpid 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 macos pip qpid


    【解决方案1】:

    如果你仍然关心 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 安装(或者更好地避免将来造成严重破坏,将以下内容添加到您的 ~/.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"
    

    这对我来说就像一个魅力!

    【讨论】:

      【解决方案2】:

      看看这个:http://svn.apache.org/repos/asf/qpid/branches/0.20/qpid/python/README.txt

      我认为如果你下载这个:https://qpid.apache.org/releases/qpid-proton-0.9.1/index.html,你只需要在你的项目中包含这个文件并且不要安装任何东西。就用它吧!

      【讨论】:

      • 感谢您的帮助。我不认为是这种情况,已经尝试了您建议的下载中的示例并且它们不起作用(ImportError:没有名为质子的模块)。不知何故,我需要安装一些东西才能让它工作。
      猜你喜欢
      • 1970-01-01
      • 2021-05-31
      • 1970-01-01
      • 2018-07-12
      • 2015-12-03
      • 2013-11-05
      • 1970-01-01
      • 1970-01-01
      • 2012-01-19
      相关资源
      最近更新 更多