【问题标题】:Problems installing PyCurl on python2.7.0+在 python2.7.0+ 上安装 PyCurl 的问题
【发布时间】:2011-01-12 18:47:13
【问题描述】:

pycurl 在 python2.6 上安装良好,但是当我尝试通过小牛上的 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吗?

【问题讨论】:

    标签: python pycurl ubuntu-10.10


    【解决方案1】:
    sudo apt-get install python-dev
    

    这样就安装了需要的Python开发包,修复了缺少头文件的问题。

    (请阅读Corey的评论)

    【讨论】:

    • 请注意,如果 2.7 不是您的默认 Python,您将需要执行“sudo apt-get install python2.7-dev”。
    猜你喜欢
    • 1970-01-01
    • 2018-05-01
    • 2018-11-26
    • 2015-04-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-10
    • 1970-01-01
    相关资源
    最近更新 更多