pycurl install :(已经有最小的libcurl版本 [英] pycurl install :( already have min. libcurl version

查看:122
本文介绍了pycurl install :(已经有最小的libcurl版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Intel Mac OS X 10.5上运行python 2.6

I'm running python 2.6 on an Intel Mac OS X 10.5

我正在尝试安装pycurl 7.16.2.1(如此处推荐 http://curl.haxx.se/mail/curlpython-2009-03/0009.html ),但由于某种原因,安装程序会看到我的libcurl 7.16.3,但仍然坚持要安装7.16. 2或更大(7.16.3不能满足吗?)

I'm trying to install pycurl 7.16.2.1 (as recommended here http://curl.haxx.se/mail/curlpython-2009-03/0009.html), but for some reason, the installation sees my libcurl 7.16.3, yet it still insist I install 7.16.2 or greater (doesn't 7.16.3 satisfy that?)

以下是错误输出:

Running pycurl-7.16.2.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-3emZIB/pycurl-7.16.2.1/egg-dist-tmp-K10rbP
Using curl-config (libcurl 7.16.3)
src/pycurl.c:54:4:src/pycurl.c:54:4: error: #error "Need libcurl version 7.16.2 or greater to compile pycurl."
 error: #error "Need libcurl version 7.16.2 or greater to compile pycurl."

可以肯定的是curl-config --version产生libcurl 7.16.3

To be certain curl-config --version yields libcurl 7.16.3

有什么建议吗?我应该升级libcurl,还是坚持使用出厂默认的lib?

Any advice? Should I upgrade libcurl, or stick with the factory default lib?

==在响应==

AFAIK我拥有的python是出厂默认设置(我自己不是从python.org上获得的)

AFAIK the python I have is factory default (I didn't get it myself from python.org)

Python 2.6.2 (r262:71600, Apr 16 2009, 09:17:39) 
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin

这是我的curl版本.看起来具有误导性,因为我使用的是Intel Macbook,而不是PPC.

And this is my curl version. Looks misleading because I'm using an Intel Macbook, not PPC.

curl 7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3
Protocols: tftp ftp telnet dict ldap http file https ftps 
Features: GSS-Negotiate IPv6 Largefile NTLM SSL libz 

我将采用与我现有的python解释器一起使用的pycurl

I'll take whichever pycurl works with my existing python interpreter

我确实有端口:

sudo port -u install py26-pycurl
Error: Port py26-pycurl not found

推荐答案

如果您使用的是python.org Python 2.6,则使用10.4 SDK进行构建,以便能够在OS X的多个版本上运行.在这种情况下,pycurl构建可能会尝试链接到libcurl的10.4版本,该版本似乎是7.13.1.链接到的线程正在谈论使用由Apple提供的10.5 Python 2.5,该Python 2.5是使用10.5库构建的,因此pycurl 7.16.2.1确实可以正确构建和安装.

If you are using the python.org Python 2.6, it is built using the 10.4 SDK so as to be able to run on multiple versions of OS X. In that case, the pycurl build is likely trying to link against the 10.4 version of libcurl, which appears to be 7.13.1. The thread you link to is talking about using the 10.5 Apple-supplied Python 2.5 which is built using 10.5 libraries and, with that, pycurl 7.16.2.1 does seem to build and install correctly.

您可以尝试手动安装pycurl;在setup.py中有一个文档化的--curl-config参数,它允许您指定curl-config要使用的路径.不幸的是,这似乎不适用于/usr/bin/curl-config;.没有添加适当的包含文件目录.除了破解setup.py文件之外,更好的方法是安装更新的libcurl并使用最新的pycurl.最简单的方法是使用MacPorts.从MacPorts安装pycurl和python2.6甚至更容易.如果您尚未使用MacPorts,请下载并安装基本文件.然后:

You can try to manually install pycurl; there is a documented --curl-config argument to its setup.py which allows you to specify the path to the curl-config to use. Unfortunately, that does not seem to work with /usr/bin/curl-config; the proper include files directories are not being added. Short of hacking the setup.py file, a better approach is to install a newer libcurl and use the latest pycurl. The easiest way to do that is to use MacPorts. Even easier is to install pycurl and python2.6 from MacPorts. If you don't already use MacPorts, download and install the base files. Then:

sudo port selfupdate
sudo port -u install py26-curl   #edited

MacPorts python2.6将位于/opt/local/bin/python2.6.

The MacPorts python2.6 will be at /opt/local/bin/python2.6.

如果您想坚持使用已安装的python2.6,请安装curl软件包:

If you'd rather stick with the python2.6 you've installed, install the curl package:

sudo port selfupdate
sudo port -u install curl

然后使用类似的方法手动安装pycurl:

Then manually install pycurl using something like:

curl http://pycurl.sourceforge.net/download/pycurl-7.19.0.tar.gz | tar xz
cd pycurl-7.19.0
python2.6 setup.py install --curl-config=/opt/local/bin/curl-config

这篇关于pycurl install :(已经有最小的libcurl版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆