【问题标题】:python.h missing on Ubuntu 18 with python-dev installed安装了 python-dev 的 Ubuntu 18 上缺少 python.h
【发布时间】:2021-04-20 22:13:03
【问题描述】:

试图让 fHDHR 在 Ubuntu 18 上工作。在安装过程中我收到此错误:

include/python3.8 -c src/gevent/libev/corecext.c -o build/temp.linux-x86_64-3.8/src/gevent/libev/corecext.o
  src/gevent/libev/corecext.c:95:10: fatal error: Python.h: No such file or directory
   #include "Python.h"
            ^~~~~~~~~~
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for gevent

我找到的大多数答案都告诉我我需要安装 python-dev,但它已经是(并且已更新)。在this 帖子中,我尝试过sudo pip install mmh3,但由于找不到python.h,它也失败了

知道我的系统缺少什么吗?

【问题讨论】:

    标签: python ubuntu-18.04 python-3.8


    【解决方案1】:

    您需要按照here 的说明安装 python3.x-dev。对我来说,这解决了这个问题。

    由于从错误行中我们可以看到您正在运行python3.8,因此对于您的情况,您需要这样做:

    sudo apt-get install python3.8-dev
    

    【讨论】:

      【解决方案2】:

      你可以尝试安装python3-dev。

      apt install python3-dev 
      

      因为你使用的是python3

      【讨论】:

      • python3-dev 已安装
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-15
      • 2019-07-05
      相关资源
      最近更新 更多