2011-01-12 107 views
6

pycurl安裝上python2.6的罰款,但我得到以下錯誤,當我嘗試通過2.7上的easy_install特立獨行問題上python2.7.0安裝PyCurl +

$ sudo easy_install pycurl 
install_dir /usr/local/lib/python2.7/dist-packages/ 
Searching for pycurl 
Reading http://pypi.python.org/simple/pycurl/ 
Reading http://pycurl.sourceforge.net/ 
Reading http://pycurl.sourceforge.net/download/ 
Best match: pycurl 7.19.0 
Downloading http://pycurl.sourceforge.net/download/pycurl-7.19.0.tar.gz 
Processing pycurl-7.19.0.tar.gz 
Running pycurl-7.19.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-PFzxzf/pycurl-7.19.0/egg-dist-tmp-oAFjdV 
Using curl-config (libcurl 7.21.0) 
src/pycurl.c:42: fatal error: Python.h: No such file or directory 
compilation terminated. 
error: Setup script exited with error: command 'gcc' failed with exit status 1 

安裝在2.7不兼容pycurl?

回答

8
sudo apt-get install python-dev 

這將安裝所需的Python開發包,並修復缺少頭文件的問題。

(請閱讀由科裏的註釋)

+1

注意,如果2.7是不是默認的Python,你會想要做「sudo易於得到安裝python2.7-dev的」代替。 – 2011-01-12 19:04:49