在python2.7.0 +上安装PyCurl的问题

时间:2011-01-12 18:47:13

标签: python pycurl ubuntu-10.10

pycurl在python2.6上安装正常,但是当我尝试在maverick上通过easy_install安装在2.7上时出现以下错误

$ 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不兼容吗?

1 个答案:

答案 0 :(得分:8)

sudo apt-get install python-dev

这会安装所需的Python开发包,并修复丢失的头文件的问题。

(请阅读Corey的评论)