python - 即使在我使用 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
但这不起作用,我一遍又一遍地得到同样的错误。
任何人都可以找到原因..?
解决方案
你可以试试 :
sudo apt install libpython3.7-dev
推荐阅读
- python - 谁能帮我解决这个 PyCharm 和 Import Modular 错误?
- asp.net-core - 如何在 asp.net 核心日志记录和应用程序洞察中记录 json
- javascript - 如何使用 cypress 视口刷新重新加载
- powershell - Powershell 将 CSV 数据输出到多行而不是单行
- sql - 防止重复预订的触发器总是标记
- python - 基于具有自定义单元格宽度和高度的 Numpy 2d 数组创建 NonUniformImage
- elasticsearch - 未登录 Kibana 的弹性搜索警报
- osc - 如何在 sclang 中使用数组值作为函数参数(在通过 OSC 发送大量浮点数的情况下)
- javascript - 遇到断点时捕获/防止页面更改:Firefox
- r - 在ggplot中省略图例的NA值