c++ - 包括 Python.h 错误:未找到 initconfig.h
问题描述
#include <python3.8/Python.h>
我不断收到错误 /usr/include/python3.8/cpython/pystate.h:9:10: fatal error: cpython/initconfig.h: No such file or directory
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 ...
推荐阅读
- vim - 有没有更快的方法将 vim-snippet 中的片段转换为 UltiSnips 格式?
- javascript - 在 node.js 服务器中,我们如何将错误(如果发生在传输之间)添加到包含图像/视频等文件数据流的响应中
- postgresql - Hibernate/Postgres revınfo 不存在
- python - 如何从 FITS 文件中进行圆形剪切并保留 WCS
- python - 如何从 web url 获取 Href Url 链接
- vue.js - Nuxt 和 Vuetify,如何在 v-toolbar 等组件中使用颜色
- facebook - Facebook 服务器端转换像素 API 是否需要域验证?
- c++ - 为什么我们可以在 C++ 中将类定义声明为结构对象?
- javascript - JavaScript 中的 this 内部箭头函数
- php - PHP如何禁用键盘输入并只允许特定的输入