Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't find "Python.h" file while installing Watchman

I use Linux Mint 17 'Quiana' and I want to install Watchman to use later Ember.js. Here were my steps:

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

then

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

and, when I ran make to compile files, it returned the following error:

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

I tried to run

$ sudo apt-get install python3-dev

but it appears to be already in my system. What have I done wrong?

like image 234
AlexNikolaev94 Avatar asked May 18 '16 10:05

AlexNikolaev94


People also ask

How do I fix python H No such file or directory?

Python h no such file or directory is a fatal error. If you are trying to build a shared library using a C extension file, you need to install the development version of Python. For example, if you use Python 3, you need to install the python3-dev.

What is python H?

Python.h is nothing but a header file. It is used by gcc to build applications. You need to install a package called python-dev. This package includes header files, a static library and development tools for building Python modules, extending the Python interpreter or embedding Python in applications.


Video Answer


3 Answers

Usually its the python-dev libs missing. Are you sure the configure uses the python 3 instead of python 2? Because if thats the case you should install python-dev instead of python3-dev.

like image 143
Tomax Avatar answered Sep 18 '22 15:09

Tomax


Same problem if you build watchman under rasbian/raspberry. Install "python-dev".

--

git clone https://github.com/facebook/watchman.git cd watchman ./autogen.sh ./configure make  sudo make install 
like image 38
Bernd Kohlstedt Avatar answered Sep 20 '22 15:09

Bernd Kohlstedt


i also did

sudo apt-get install python3-dev

it was still giving me the error then i ran this command

sudo apt-get install python-dev

after that.

make 
sudo make install
like image 37
Vikas Singh Avatar answered Sep 18 '22 15:09

Vikas Singh