Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

include Python.h error : initconfig.h not found

Tags:

c++

c

python-3.x

#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.

like image 488
JustCallMeMike Avatar asked Aug 02 '20 03:08

JustCallMeMike


1 Answers

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 ...
like image 113
gemfield Avatar answered Oct 08 '22 10:10

gemfield