6
votes
#include <python3.8/Python.h>

I keep getting the error /usr/include/python3.8/cpython/pystate.h:9:10: fatal error: cpython/initconfig.h: No such file or directory

9 | #include "cpython/initconfig.h"

Originally i just included Python.h, but that could not be found at all. I'm also running Void Linux, and already installed python3-devel if that makes a diffrence.

1
You cannot and should not include Python.h this way. You need to #include <Python.h> and pass an appropriate -I command line argument to the compiler, e.g. -I/usr/include/python3.8. - n. 1.8e9-where's-my-share m.

1 Answers

3
votes

try locate your Python.h:

gemfield@ThinkPad-X1C:~$ locate Python.h
/home/gemfield/anaconda3/include/python3.7m/Python.h
/home/gemfield/anaconda3/pkgs/python-3.7.6-h0371630_2/include/python3.7m/Python.h
/usr/include/python3.8/Python.h

Then

g++ -I/usr/include/python3.8 ...