在Mac OS上安装pycurl for Python 2.6

在Mac OS上安装pycurl for Python 2.6,python,macos,python-2.6,pycurl,Python,Macos,Python 2.6,Pycurl,我有一个Mac操作系统(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 versio

我有一个Mac操作系统(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
但它适用于Python2.7,而不是2.6

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

 python -V 
 Python 2.6.9
我还尝试手动安装(下载.tar并安装)

输出:

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
您知道如何安装pycurl for Python 2.6吗?

试试看

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
试一试

输出

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

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

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

问题出在哪里?它已经安装好了。pycurl 7.19.5.3已经是活动版本了,这是Python 2.7而不是2.6的问题。Python2.6仍然没有看到PyCurl,你怎么知道的?您的
python-V
显示了2.6版,因为我正试图在python解释器中导入pycurl。它说:importorror:没有名为pycurl的模块。此外,“pycurl-7.19.5.3-py2.7-macosx-10.11-intel.egg”肯定适用于2.7,因为您可以看到问题所在的可能重复?它已经安装好了。pycurl 7.19.5.3已经是活动版本了,这是Python 2.7而不是2.6的问题。Python2.6仍然没有看到PyCurl,你怎么知道的?您的
python-V
显示了2.6版,因为我正试图在python解释器中导入pycurl。它说:importorror:没有名为pycurl的模块。此外,“pycurl-7.19.5.3-py2.7-macosx-10.11-intel.egg”绝对是2.7版的,因为你可以看到可能的重复作品!非常感谢你!作品非常感谢你!