albertyw/albertyw.com

View on GitHub
app/notes/20171216-1246.md

Summary

Maintainability
Test Coverage
Fixing "Fatal Error: Python.h: No Such File or Directory"

fixing-python-h

1513428397

Some python packages, notably uWSGI and mypy, require access to a `Python.h` file
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](https://stackoverflow.com/questions/21530577/fatal-error-python-h-no-such-file-or-directory)
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
Ubuntu PPA).

If you do have multiple python versions available, (on an Ubuntu system)
explicitly specify the python version of the dev tools package, e.g.

```bash
sudo apt install python3.6-dev
```