简体   繁体   English

如何修复 Arch Linux 上缺少的“Python.h”?

[英]How to fix missing “Python.h” on Arch Linux?

Including "Python.h" in a C file:在 C 文件中包含“Python.h”:

#include <Python.h>

gives Python.h: No such file or directory error.给出Python.h: No such file or directory错误。 I looked up for other people having the same problem and none gave a direct answer on how to install python*-dev (python2 and python3) on arch Linux.我查找了其他有同样问题的人,但没有人直接回答如何在拱 Linux 上安装 python*-dev(python2 和 python3)。 And by the way, this answer doesn't have an arch installation command.顺便说一句, 这个答案没有拱形安装命令。

Turns out "Python.h" is already installed on Arch, but just wasn't in the standard header files location gcc $(pkg-config --cflags python3) testing.c -o testing solved it for me.原来“Python.h”已经安装在 Arch 上,但只是不在标准 header 文件位置gcc $(pkg-config --cflags python3) testing.c -o testing解决了它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM