【问题标题】:Can't find "Python.h" file while installing Watchman安装 Watchman 时找不到“Python.h”文件
【发布时间】:2016-05-18 10:53:23
【问题描述】:

我使用 Linux Mint 17 'Quiana',我想安装 Watchman 以在以后使用 Ember.js。以下是我的步骤:

$ git clone https://github.com/facebook/watchman.git

然后

$ cd watchman
$ ./autogen.sh
$ ./configure.sh

当我运行make 编译文件时,它返回了以下错误:

pywatchman/bser.c:31:20: fatal error: Python.h: no such file or directory
#include <Python.h>
                ^
compilation terminated.
error: command 'i686-linux-gnu-gcc' failed with exit status 1
make[1]: *** [py-build] Error 1
make[1]: Leaving the directory `/home/alex/watchman'
make: *** [all] Error 2

我试着跑了

$ sudo apt-get install python3-dev

但它似乎已经在我的系统中。我做错了什么?

【问题讨论】:

  • 你也试过安装libpython3-dev吗?
  • 通常缺少 python-dev 库。你确定配置使用python 3而不是python 2吗?因为如果是这种情况,您应该安装python-dev 而不是python3-dev。 @NilsWerner python3-dev 应该安装 libpython3-dev 作为依赖项。
  • 好吧,如果它是我的猜测也是 Python 2/3 配置问题。
  • 你需要 python-dev 而不是 python3-dev。守望者使用python2
  • @Tomax,所以你是对的,这就是问题所在 - 我必须安装 python 2 dev,现在它可以工作了。谢谢!

标签: python linux watchman


【解决方案1】:

通常缺少 python-dev 库。你确定配置使用python 3而不是python 2吗?因为如果是这种情况,您应该安装 python-dev 而不是 python3-dev

【讨论】:

  • 在 Fedora 24 上你需要sudo dnf install python-devel
  • sudo yum install python-devel 用于 CENTOS
【解决方案2】:

如果你在 rasbian/raspberry 下构建 watchman 也会出现同样的问题。安装“python-dev”。

--

git clone https://github.com/facebook/watchman.git
cd watchman
./autogen.sh
./configure
make

sudo make install

【讨论】:

    【解决方案3】:

    我也做过

    sudo apt-get install python3-dev
    

    它仍然给我错误然后我运行了这个命令

    sudo apt-get install python-dev
    

    在那之后。

    make 
    sudo make install
    

    【讨论】:

      【解决方案4】:

      在 Fedora 32 上运行: sudo dnf install python-devel

      【讨论】:

        猜你喜欢
        • 2016-06-17
        • 2018-09-01
        • 2014-10-20
        • 1970-01-01
        • 1970-01-01
        • 2020-01-21
        • 2012-09-04
        • 2016-09-17
        • 1970-01-01
        相关资源
        最近更新 更多