简体   繁体   English

Windows 中缺少 Python.h

[英]Missing Python.h in Windows

I'm trying to run some python code from my c program by using the python.h header but I keep getting fatal error: Python.h: No such file or directory I'm trying to run some python code from my c program by using the python.h header but I keep getting fatal error: Python.h: No such file or directory

After checking my anaconda environment, I have found a Python.h file in ...Anaconda/envs/myenv/include I tried adding this path to my system variable's PATH but it didn't work.在检查了我的 anaconda 环境后,我在...Anaconda/envs/myenv/include中找到了一个 Python.h 文件,我尝试将此路径添加到我的系统变量的 PATH 中,但它不起作用。 How can I include the Python.h file from my anaconda env to my program?如何将 anaconda 环境中的 Python.h 文件包含到我的程序中?

PATH is only used for executables, not C headers. PATH仅用于可执行文件,而不用于 C 标头。 Tell your compiler or build system to add this path.告诉您的编译器或构建系统添加此路径。 On gcc and clang, for example, it's the -I flag.例如,在 gcc 和 clang 上,它是-I标志。

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

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