开发者

How do I install pycurl for python2.6 (CentOS 5)

开发者 https://www.devze.com 2023-01-17 18:39 出处:网络
I can\'t install pycurl for python 2.6 on my server run CentOS 5. I use easy_install-2.6, but it output many errors.

I can't install pycurl for python 2.6 on my server run CentOS 5. I use easy_install-2.6, but it output many errors.

output here: http://pastebin.com/Dw92H7fC

Help would be grea开发者_如何学JAVAt. : )


I have no experience with CentOS in particular, but as a general rule of thumb you should always use your system's package manager to install things unless you have very special needs. The package manager makes installation/uninstallation a breeze, and more importantly, makes it simple to manage security updates and to avoid breakage when upgrading your OS.

In your case I believe the package manager is yum. It probably has some search function that allows you to look for pycurl, but I would guess the package's name is something like python-pycurl (at least it is in Debian and related distros). Hence

yum install python-pycurl

is the preferred way to install PyCURL.


How did you install python? You probably need to do:

yum install python26-devel


I found answer from serverfault

https://serverfault.com/questions/235981/installing-libcurl-7-19-on-centos5

I figured it out. For anyone who may be interested here is what I did.

  1. Build your desired version of curl/libcurl in an alternate directory (I used /opt/curl) following the instructions here http://markus.revti.com/2009/12/install-rtorrent-using-curl-in-different-path-on-centos-linux/

  2. Grab the pycurl source for the appropriate libcurl version here http://pycurl.sourceforge.net/download/

  3. Run setup.py and tell it to build against your alternate libcurl, i.e. python26 setup.py install --curl-config=/opt/curl/bin/curl-config


It looks as if you didn't install the development components of Python correctly (especially the headers: it can't find Python.h). Install them to the correct location and it should just work. Python usually does this pretty well if you run make install, so it makes me wonder how you installed it?

0

精彩评论

暂无评论...
验证码 换一张
取 消