[英]fatal error: numpy/arrayobject.h: No such file or directory #include "numpy/arrayobject.h" in google colab
hello i am trying to run a git repo in google colab, i installed all requirements as per the git instruction你好,我正在尝试在 google colab 中运行 git repo,我按照 git 指令安装了所有要求
while running the certain file i am getting this error在运行某个文件时,我收到此错误
fatal error: numpy/arrayobject.h: No such file or directory致命错误:numpy/arrayobject.h:没有这样的文件或目录
#include "numpy/arrayobject.h" #include "numpy/arrayobject.h"
i already checked solution for this error but they recommended to change the code in setup.py but i am running the file in google colab so some body help me我已经检查了此错误的解决方案,但他们建议更改 setup.py 中的代码,但我正在 google colab 中运行该文件,因此某些机构可以帮助我
the command i ran in google colab was我在 google colab 中运行的命令是
!python build.py build_ext --inplace
for which i got the following error could some body help me , i verified that numpy was already installed对于我收到以下错误,有人可以帮助我吗,我确认已经安装了 numpy
running build_ext
skipping '_nms_gpu_post.c' Cython extension (up-to-date)
building '_nms_gpu_post' extension
creating build/temp.linux-x86_64-3.6
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.6m -c _nms_gpu_post.c -o build/temp.linux-x86_64-3.6/_nms_gpu_post.o
_nms_gpu_post.c:485:10: fatal error: numpy/arrayobject.h: No such file or directory
#include "numpy/arrayobject.h"
^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
I had a similar problem and I solved it by editing build.py
:我有一个类似的问题,我通过编辑build.py
解决了它:
ext_modules=[
Extension("my_module", ["my_module.c"],
include_dirs=[numpy.get_include()]),
]
Here include_dirs=[numpy.get_include()]
is the part that's needed to solve it.这里include_dirs=[numpy.get_include()]
是解决它所需的部分。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.