Missing Python.h file when installing nerd.vision

Ben

October 17, 2019

Missing Python.h file when installing nerd.vision

Description

When installing the nerd.vision python module you get an error:

psutil/_psutil_common.c:9:20: fatal error: Python.h: No such file or directory
  #include <python.h></python.h>
                     ^
 compilation terminated.
 error: command 'i686-linux-gnu-gcc' failed with exit status 1

This is caused by the missing python dev package that is needed to compile the psutil python module which is a dependency of nerd.vision.

The Solution

The solution is to install the missing python dev package which includes the python header files needed for the compilation. These can be installed using the standard package manager on linux.

apt install python-dev

or

yum install python-devel

If you are using various versions of python on the system then you might need to install the specific version of the headers. These can be installed using:

apt install python3.5-dev

Where you can replace the version '3.5' with the version you need to install. For more information on installing the psutil module you can view the install guide here or read there git issue here.

Ben

Ben

Experienced developer in various languages, currently a product owner of nerd.vision leading the back end architecture.