[英]How to make Python.h file work in Ubuntu?
I am on an Ubuntu machine and I want to use python in my C code but when I include the Python.h
header file, it shows a warning: Python.h: No such file or directory
任何方法。 我已经尝试过使用:
sudo apt-get install python3-dev
和;
sudo apt-get install python-dev
但它一直显示错误。
Python.h 文件不在默认编译器包含路径中。
将pkg-config --cflags python3
的 output 添加到编译器命令行。
现在编译器将知道在哪里可以找到 Python.h(以及它可能具有的任何依赖项)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.