gpt4 book ai didi

python - Cython fatal error : Python. h 没有这样的文件或目录

转载 作者:太空狗 更新时间:2023-10-29 22:07:41 29 4
gpt4 key购买 nike

我一直在使用 Cython 将我的 Python 文件编译成 C 文件,然后使用 MinGW 从 C 文件创建可执行文件。 Cython 工作正常,我可以在命令行中键入 cython test.pyx 并获取 C 文件。问题是当我试图从 C 文件编译可执行文件时。如果我输入 gcc test.c,我会收到以下错误:

test.c:4:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.

我非常感谢您的帮助。我正在运行 Windows 7 和 Python 3.5。

最佳答案

您可能没有安装 python-dev。根据您的操作系统,您需要执行以下操作:

sudo apt-get install python-dev

你会在 Ubuntu 上做什么

关于python - Cython fatal error : Python. h 没有这样的文件或目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34668675/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com