16

I use ubuntu 16.04 and python 2.7.12.

When I try to install pycurl with pip, I could see below log.

aaa@bbb:~/git/ccc$ sudo pip install pycurl
  Downloading pycurl-7.43.0.tar.gz (182kB)
    100% |████████████████████████████████| 184kB 515kB/s 
Installing collected packages: pycurl
  Running setup.py install for pycurl ... error

...

    In file included from src/docstrings.c:4:0:
    src/pycurl.h:173:30: fatal error: gnutls/gnutls.h: No such file or directory
    compilation terminated.

How to install pycurl with above log?

xoska74
  • 1,450
  • 2
  • 11
  • 17

2 Answers2

37

Install gnutls first using:

sudo apt-get install libgnutls28-dev

Then try again.

Kyle Higginson
  • 922
  • 6
  • 11
  • 1
    I faced the same problem on mint 19.1. apt-get install'ing the libgnutls28-dev package helped resolve the problem. After adding the above package, was able to get pycurl installed and functioning in a venv with the following command: `pip install --compile --no-cache-dir --global-option="--with-gnutls" pycurl` – Lance Feb 09 '19 at 19:20
  • Thanks ! This is still relevant with Ubuntu 20.04, Python 3.8 and PyCURL 7.45 – vidlb Apr 14 '22 at 16:44
7

I found the answer by myself.

Need to install libgnutls28-dev like below first.

sudo apt-get install libgnutls28-dev
xoska74
  • 1,450
  • 2
  • 11
  • 17