甚至在我使用sudo安装之后也找不到Python.h

2024-10-03 21:36:59 发布

您现在位置:Python中文网/ 问答频道 /正文

我一直在从以下链接研究暗流; https://github.com/thtrieu/darkflow
在Ubuntu 20.04上
我认为我的流文件中有问题,所以我尝试用以下代码重建构建文件

dyi@D-FIP7VAE:~/Tiny-YOLO-voc-traffic-sign-detection$ python3.7 setup.py build_ext --inplace<br/>

这就是我得到的。

setup.py:6: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses import imp running build_ext building 'darkflow.cython_utils.nms' extension x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-ZE4Yn0/python3.7-3.7.10=. -fstack-protector-strong -Wformat -Werror=format-security -g -fdebug-prefix-map=/build/python3.7-ZE4Yn0/python3.7-3.7.10=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/dyi/.local/lib/python3.7/site-packages/numpy/core/include -I/usr/include/python3.7m -c darkflow/cython_utils/nms.c -o build/temp.linux-x86_64-3.7/darkflow/cython_utils/nms.o darkflow/cython_utils/nms.c:29:10: fatal error: Python.h: No such file or directory 29 | #include "Python.h"
| ^~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

所以我尝试了这个

sudo apt-get install python3-dev

但这不起作用,我一次又一次地犯同样的错误。
有人能找到…的原因吗


Tags: 文件thepybuildincludelinuxsetuputils