#include <python3.8/Python.h>
我总是犯错误/usr/include/python3.8/cpython/pystate.h:9:10:致命错误:cpython/initconfig.h:没有这样的文件或目录
9 | #include "cpython/initconfig.h"
最初我只是包含了Python.h,但根本找不到。我也在运行Void Linux,并且已经安装了python3-devel(如果有区别的话(。
尝试定位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
然后
g++ -I/usr/include/python3.8 ...