gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-29 22:27:58 24 4
gpt4 key购买 nike

pycurl 在 python2.6 上安装正常,但是当我尝试通过 easy_install on maverick 在 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吗?

最佳答案

sudo apt-get install python-dev

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

(请阅读科里的评论)

关于python - 在 python2.7.0+ 上安装 PyCurl 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4672682/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com