安装pycurl 7.19.0时出错 [英] Error in installation pycurl 7.19.0

查看:121
本文介绍了安装pycurl 7.19.0时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要安装此特定版本(7.19.0)pycurl.

I need install this specific version (7.19.0) pycurl.

当我尝试使用此命令进行安装时:

When I try to install with this command:

pip install pycurl == 7.19.0

pip install pycurl==7.19.0

我收到此错误.

Failed building wheel for pycurl   Running setup.py clean for pycurl Failed to build pycurl Installing collected packages: pycurl

..... // MULTIPLE LINES

 build/temp.linux-x86_64-2.7/src/pycurl.o: na função `initpycurl':
    /tmp/pip-build-4Q4V7Q/pycurl/src/pycurl.c:3904: referência indefinida para `PyEval_InitThreads'
    collect2: error: ld returned 1 exit status
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ---------------------------------------- Command "/home/user/.virtualenvs/myenv/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-4Q4V7Q/pycurl/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-UlYKto-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/.virtualenvs/myenv/include/site/python2.7/pycurl" failed with error code 1 in /tmp/pip-build-4Q4V7Q/pycurl/

如何安装此特定版本?

我正在使用Ubuntu 16.

I'm using Ubuntu 16.

谢谢!

推荐答案

在环境中运行:

apt-cache depends python-pycurl

它将输出类似于:

  Depends: python
  Depends: python
  Depends: <python:any>
    python
  Depends: libc6
  Depends: libcurl3-gnutls
  Suggests: libcurl4-gnutls-dev
  Suggests: python-pycurl-dbg
  Suggests: python-pycurl-doc

安装libcurl4-gnutls-dev:

Install libcurl4-gnutls-dev:

sudo apt-get install libcurl4-gnutls-dev

现在检查是否可以在环境中安装pycurl:

Check now if you can install pycurl within env:

pip install pycurl

如果它不起作用并抛出错误无法创建车轮"或类似原因,请进一步执行以下操作:

If it is not working and throws error "Cannot create wheel" or similar go further with:

apt-cache search gnutl | grep dev

输出为:

libcurl4-gnutls-dev - development files and documentation for libcurl (GnuTLS flavour)
libgnutls-dev - GNU TLS library - development files
libgnutls28-dev - dummy transitional package for GNU TLS library - development files
libneon27-gnutls-dev - Header and static library files for libneon27 (GnuTLS enabled)
libsoup-gnome2.4-dev - HTTP library implementation in C -- GNOME support development files

就我而言,安装后:

sudo apt-get install libgnutls-dev

我能够在virtualenv中安装PyCurl

I was able to install PyCurl within virtualenv

这篇关于安装pycurl 7.19.0时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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