当前位置:   article > 正文

include Python.h error : initconfig.h not found_/usr/include/python3.8/cpython/pystate.h:9:10: fat

/usr/include/python3.8/cpython/pystate.h:9:10: fatal error: cpython/initconf

原帖链接:
https://stackoverflow.com/questions/63211981/include-python-h-error-initconfig-h-not-found

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.

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
  • 1
  • 2
  • 3
  • 4

Then

g++ -I/usr/include/python3.8 ...
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/537284
推荐阅读
相关标签
  

闽ICP备14008679号