2011-01-12 31 views
6

pycurl cài đặt tốt trên python2.6 nhưng tôi nhận được lỗi sau khi tôi cố gắng để cài đặt ở trên 2,7 qua easy_install trên MaverickSự cố cài đặt PyCurl trên python2.7.0 +

$ 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 

là 2,7 không tương thích với pycurl?

Trả lời

8
sudo apt-get install python-dev 

Thao tác này sẽ cài đặt gói phát triển Python cần thiết và khắc phục sự cố tệp tiêu đề bị thiếu.

(Vui lòng đọc nhận xét của Corey)

+1

lưu ý rằng nếu 2.7 không phải là Python mặc định của bạn, bạn sẽ muốn "sudo apt-get install python2.7-dev" thay thế. –

+0

Điểm, tôi sẽ cập nhật nó. – user225312

Các vấn đề liên quan