首页 > 解决方案 > 即使在我使用 sudo install 后也找不到 Python.h

问题描述

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

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

这就是我得到的。

setup.py:6: DeprecationWarning: imp 模块已被弃用,取而代之的是 importlib;请参阅模块的文档以了解替代用途 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:致命错误:Python.h:没有这样的文件或目录 29 | #include "Python.h"
| ^~~~~~~~~~
编译终止。
错误:命令“x86_64-linux-gnu-gcc”失败,退出状态为 1

所以我尝试了这个

sudo apt-get install python3-dev

但这不起作用,我一遍又一遍地得到同样的错误。
任何人都可以找到原因..?

标签: pythonlinuxubuntu

解决方案


你可以试试 :

sudo apt install libpython3.7-dev

推荐阅读