2016-02-11 158 views
0

我有一個Mac OS(El Capitan 10.11.3),我試圖爲Python 2.6.9安裝pycurl庫。不幸的是,當我嘗試:在Mac OS上爲Python 2.6安裝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?

+0

問題是什麼?它已經安裝。 ** pycurl 7.19.5.3已經是活動版本** –

+0

它是Python 2.7的問題,而不是2.6。 Python 2.6仍然沒有看到pycurl – Konrad

+0

你怎麼知道這一點?你的'python -V'顯示版本2.6 –

回答

1

嘗試

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 
+0

工程!非常感謝你! – Konrad

2

我建議,如果可能的話,就避免了直接安裝軟件包到你的系統。嘗試根據您的項目使用它們,使用諸如virtualenv之類的工具。這樣可以避免衝突,並且您還可以根據需要選擇特定版本。