繁体   English   中英

在Mac OS上安装python 2.6的pycurl

[英]Installing pycurl for Python 2.6 on Mac OS

我有一个Mac OS(El Capitan 10.11.3),我正在尝试为python 2.6.9安装pycurl库。 不幸的是,当我尝试:

 easy_install pycurl

我有:

 Searching for pycurl
 Best match: pycurl 7.19.5.3
 Processing pycurl-7.19.5.3-py2.7-macosx-10.11-intel.egg
 pycurl 7.19.5.3 is already the active version in easy-install.pth

但这是针对python 2.7而非2.6的。

在bash中检查当前的Python版本:

 python -V 
 Python 2.6.9

我也尝试手动安装(下载.tar并安装)

sudo python setup.py install

输出:

Using curl-config (libcurl 7.43.0)
running install
running build
running build_py
running build_ext
running install_lib
running install_data
creating /System/Library/Frameworks/Python.framework/Versions/2.7/share
error: could not create '/System/Library/Frameworks/Python.framework/Versions/2.7/share': Operation not permitted

相同的:

make PYTHON=python2.6

您是否知道如何使其安装python 2.6的pycurl?

我建议,如果可能,请避免将软件包直接安装到系统中。 尝试使用诸如virtualenv之类的工具根据您的项目使用它们。 这样可以避免冲突,并且您还可以根据需要选择特定的版本。

尝试

sudo python2.6 -m easy_install pycurl

输出

Installed /Library/Python/2.6/site-packages/pycurl-7.43.0-py2.6-macosx-10.11-intel.egg

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM