Fixing "fatal error: Python.h: No such file or directory"
Some python packages, notably uWSGI and mypy, require access to a
to compile C bindings and they’ll fail with an ugly
fatal error: Python.h: No such file or directory error if one can’t be located
on your system. Stackoverflow
gives a pretty good answer on fixing this, but I want to amend the top answer
in case your system has multiple versions of python 3 (e.g. you’re using an
If you do have multiple python versions available, (on an Ubuntu system) explicitly specify the python version of the dev tools package, e.g.
sudo apt install python3.6-dev