Error in installation pycurl 7.19.0
Asked Answered
B

3

12

I need install this specific version (7.19.0) pycurl.

When I try to install with this command:

pip install pycurl==7.19.0

I'm receiving this error.

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/

How can I do to install this specific version?

I'm using Ubuntu 16.

Thanks!

Breechcloth answered 7/6, 2016 at 2:8 Comment(1)
Can you try sudo apt-get install python-dev and retry the pip install?Tryck
O
22

Run within environment:

apt-cache depends python-pycurl

It will output something similar to:

  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

Install libcurl4-gnutls-dev:

sudo apt-get install libcurl4-gnutls-dev

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

The output is:

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

In my case, after installing:

sudo apt-get install libgnutls-dev

I was able to install PyCurl within virtualenv

Ousley answered 2/12, 2016 at 16:21 Comment(3)
sudo apt-get install libgnutls-dev did the trick for me (Ubuntu 16.04)Goss
if you get the error Package libgnutls-dev is not available for the last command, then instead of sudo apt-get install libgnutls-dev use sudo apt-get install libgnutls28-devMarkhor
THx @Sherlock. I'm on Ubuntu 18.04 and your suggestion worked (as opposed to the original suggestion posted in the answer).Lashaunda
T
3

I had the same error and was unable to find a way to install pycurl==7.19.0 on Ubuntu 16.04. I instead switched to pycurl==7.43.0 and pip installed it just fine.

Thracian answered 28/6, 2016 at 15:27 Comment(0)
Z
0

apt-get install libpython3.x-dev libnss3 libnss3-dev

Fixed the issue. replace x with your version of python

Zephyrus answered 14/11, 2021 at 10:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.