在ActivePython-2.6中安装pyCurl?

发布于 2024-07-25 07:24:38 字数 3044 浏览 18 评论 0原文

我过去曾使用过 pyCurl 并让它与我的系统默认 python 安装一起使用。 但是,我有一个项目需要 python 更具可移植性,并且我正在使用 ActivePython-2.6。

到目前为止,我安装任何其他模块都没有问题,但安装 pyCurl 时出现错误。 错误:

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-tfVLW6/pycurl-7.19.0/egg-dist-tmp-p1WjAy
sh: curl-config: not found
Traceback (most recent call last):
  File "/opt/ActivePython-2.6/bin/easy_install", line 8, in <module>
    load_entry_point('setuptools==0.6c9', 'console_scripts', 'easy_install')()
  File "/opt/ActivePython-2.6/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/setuptools/command/easy_install.py", line 1671, in main
  File "/opt/ActivePython-2.6/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/setuptools/command/easy_install.py", line 1659, in with_ei_usage
  File "/opt/ActivePython-2.6/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/setuptools/command/easy_install.py", line 1675, in <lambda>
  File "/opt/ActivePython-2.6/lib/python2.6/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/opt/ActivePython-2.6/lib/python2.6/distutils/dist.py", line 975, in run_commands
    self.run_command(cmd)
  File "/opt/ActivePython-2.6/lib/python2.6/distutils/dist.py", line 995, in run_command
    cmd_obj.run()
  File "/opt/ActivePython-2.6/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/setuptools/command/easy_install.py", line 211, in run
  File "/opt/ActivePython-2.6/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/setuptools/command/easy_install.py", line 446, in easy_install
  File "/opt/ActivePython-2.6/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/setuptools/command/easy_install.py", line 476, in install_item
  File "/opt/ActivePython-2.6/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/setuptools/command/easy_install.py", line 655, in install_eggs
  File "/opt/ActivePython-2.6/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/setuptools/command/easy_install.py", line 930, in build_and_install
  File "/opt/ActivePython-2.6/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/setuptools/command/easy_install.py", line 919, in run_setup
  File "/opt/ActivePython-2.6/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/setuptools/sandbox.py", line 27, in run_setup
  File "/opt/ActivePython-2.6/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/setuptools/sandbox.py", line 63, in run
  File "/opt/ActivePython-2.6/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/setuptools/sandbox.py", line 29, in <lambda>
  File "setup.py", line 90, in <module>
Exception: `curl-config' not found -- please install the libcurl development files

我的系统确实安装了 libcurl,但 ActivePython 似乎没有找到它。

任何想法都会有所帮助!

I have worked with pyCurl in the past and have it working with my system default python install. However, I have a project that requires python to be more portable and I am using ActivePython-2.6.

I have had no problems installing any other modules so far, but am getting errors installing pyCurl.
The error:

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-tfVLW6/pycurl-7.19.0/egg-dist-tmp-p1WjAy
sh: curl-config: not found
Traceback (most recent call last):
  File "/opt/ActivePython-2.6/bin/easy_install", line 8, in <module>
    load_entry_point('setuptools==0.6c9', 'console_scripts', 'easy_install')()
  File "/opt/ActivePython-2.6/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/setuptools/command/easy_install.py", line 1671, in main
  File "/opt/ActivePython-2.6/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/setuptools/command/easy_install.py", line 1659, in with_ei_usage
  File "/opt/ActivePython-2.6/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/setuptools/command/easy_install.py", line 1675, in <lambda>
  File "/opt/ActivePython-2.6/lib/python2.6/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/opt/ActivePython-2.6/lib/python2.6/distutils/dist.py", line 975, in run_commands
    self.run_command(cmd)
  File "/opt/ActivePython-2.6/lib/python2.6/distutils/dist.py", line 995, in run_command
    cmd_obj.run()
  File "/opt/ActivePython-2.6/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/setuptools/command/easy_install.py", line 211, in run
  File "/opt/ActivePython-2.6/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/setuptools/command/easy_install.py", line 446, in easy_install
  File "/opt/ActivePython-2.6/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/setuptools/command/easy_install.py", line 476, in install_item
  File "/opt/ActivePython-2.6/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/setuptools/command/easy_install.py", line 655, in install_eggs
  File "/opt/ActivePython-2.6/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/setuptools/command/easy_install.py", line 930, in build_and_install
  File "/opt/ActivePython-2.6/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/setuptools/command/easy_install.py", line 919, in run_setup
  File "/opt/ActivePython-2.6/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/setuptools/sandbox.py", line 27, in run_setup
  File "/opt/ActivePython-2.6/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/setuptools/sandbox.py", line 63, in run
  File "/opt/ActivePython-2.6/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/setuptools/sandbox.py", line 29, in <lambda>
  File "setup.py", line 90, in <module>
Exception: `curl-config' not found -- please install the libcurl development files

My system does have libcurl installed, but ActivePython doesn't seem to find it.

Any ideas will help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

梦里°也失望 2024-08-01 07:24:38

安装 pycurl 需要以下依赖项:

apt-cache depends python-pycurl
python-pycurl
 Depends: libc6
Depends: libcurl3-gnutls
Depends: libgcrypt11
Depends: python2.7
Depends: python
Depends: python
Suggests: libcurl4-gnutls-dev
Suggests: python-pycurl-dbg
Conflicts: <python2.3-pycurl>
Conflicts: <python2.3-pycurl:i386>
Conflicts: <python2.4-pycurl>
Conflicts: <python2.4-pycurl:i386>
Replaces: <python2.3-pycurl>
Replaces: <python2.3-pycurl:i386>
Replaces: <python2.4-pycurl>
Replaces: <python2.4-pycurl:i386>
Conflicts: python-pycurl:i386

运行此命令

sudo apt-get install libcurl4-gnutls-dev librtmp-dev

然后您可以使用

pip install pycurl

或安装 pycurl

easy_install pycurl

Following dependencies are needed for installing pycurl:

apt-cache depends python-pycurl
python-pycurl
 Depends: libc6
Depends: libcurl3-gnutls
Depends: libgcrypt11
Depends: python2.7
Depends: python
Depends: python
Suggests: libcurl4-gnutls-dev
Suggests: python-pycurl-dbg
Conflicts: <python2.3-pycurl>
Conflicts: <python2.3-pycurl:i386>
Conflicts: <python2.4-pycurl>
Conflicts: <python2.4-pycurl:i386>
Replaces: <python2.3-pycurl>
Replaces: <python2.3-pycurl:i386>
Replaces: <python2.4-pycurl>
Replaces: <python2.4-pycurl:i386>
Conflicts: python-pycurl:i386

Run this command

sudo apt-get install libcurl4-gnutls-dev librtmp-dev

Then you can install pycurl using

pip install pycurl

or

easy_install pycurl
你怎么这么可爱啊 2024-08-01 07:24:38

我找不到要添加到路径中的curl-config,这是有道理的,因为它不是一个可以调用的模块(据我所知)

答案最终有点黑客,但它有效。

由于我在本机 python2.6 安装中使用了 pyCurl,因此我只需将本机安装中的curl 和 pycurl 项复制到 ActivePython 安装中即可。

I couldn't find a curl-config to add to the path, which makes sense as it's not a module that can be called (as far as I can tell)

The answer ended up being a bit of a hack, but it works.

As I had pyCurl working in my native python2.6 install, I simply copied the curl and pycurl items from the native install into the ActivePython install.

心碎的声音 2024-08-01 07:24:38
$ apt-cache depends python-pycurl
python-pycurl
  Depends: libc6
  Depends: libcurl3-gnutls
  Depends: libgnutls26
  Depends: libidn11
  Depends: libkrb53
  Depends: libldap-2.4-2
  Depends: zlib1g
  Depends: python
  Depends: python
  Depends: python-central
[...]

因此,首先通过 sudo aptitude install libcurl3-gnutls(或您的发行版的包管理器)安装依赖项,然后运行 ​​easy_install pycurl。

$ apt-cache depends python-pycurl
python-pycurl
  Depends: libc6
  Depends: libcurl3-gnutls
  Depends: libgnutls26
  Depends: libidn11
  Depends: libkrb53
  Depends: libldap-2.4-2
  Depends: zlib1g
  Depends: python
  Depends: python
  Depends: python-central
[...]

So first install the dependencies via sudo aptitude install libcurl3-gnutls (or the package manager of your distribution) and then run easy_install pycurl.

手长情犹 2024-08-01 07:24:38

看起来 curl-config 不在您的路径中。 尝试从命令行运行它并根据需要调整 PATH 环境变量,以便 Python 可以找到它。

It looks like curl-config isn't in your path. Try running it from the command line and adjust the PATH environment variable as needed so that Python can find it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文