【问题标题】:Installing pycurl with 'fatal error: gnutls/gnutls.h: No such file or directory'安装 pycurl 时出现“致命错误:gnutls/gnutls.h:没有这样的文件或目录”
【发布时间】:2018-02-27 15:44:03
【问题描述】:

我使用的是 ubuntu 16.04 和 python 2.7.12。

当我尝试使用 pip 安装 pycurl 时,我可以看到以下日志。

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.

上面的日志如何安装pycurl?

【问题讨论】:

    标签: python ubuntu installation pycurl


    【解决方案1】:

    首先使用以下命令安装 gnutls:

    sudo apt-get install libgnutls28-dev
    

    然后再试一次。

    【讨论】:

    • 我在 mint 19.1 上遇到了同样的问题。 apt-get install'ing libgnutls28-dev 软件包有助于解决问题。添加上述软件包后,可以使用以下命令安装 pycurl 并在 venv 中运行:pip install --compile --no-cache-dir --global-option="--with-gnutls" pycurl
    【解决方案2】:

    我自己找到了答案。

    需要先安装 libgnutls28-dev,如下所示。

    sudo apt-get install libgnutls28-dev
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-11-27
      • 1970-01-01
      • 1970-01-01
      • 2016-05-04
      • 1970-01-01
      • 2018-10-25
      • 2019-11-29
      • 1970-01-01
      相关资源
      最近更新 更多