【发布时间】:2016-05-22 21:29:55
【问题描述】:
我有一个 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 吗?
【问题讨论】:
-
有什么问题?它已经安装好了。 pycurl 7.19.5.3 已经是活动版本
-
问题在于 Python 2.7,而不是 2.6。 Python 2.6 仍然看不到 pycurl
-
你怎么知道的?您的
python -V显示版本 2.6 -
因为我试图在 Python 解释器中导入 pycurl。它说: ImportError:没有名为 pycurl 的模块。此外,如您所见,“pycurl-7.19.5.3-py2.7-macosx-10.11-intel.egg”绝对适用于 2.7
标签: python macos python-2.6 pycurl