简体   繁体   English

致命错误:numpy/arrayobject.h:google colab 中没有这样的文件或目录#include“numpy/arrayobject.h”

[英]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.

相关问题 Cython:“致命错误:numpy/arrayobject.h:没有这样的文件或目录” - Cython: "fatal error: numpy/arrayobject.h: No such file or directory" 致命错误:numpy / arrayobject.h:没有这样的文件或目录 - fatal error: numpy/arrayobject.h: No such file or directory cimport给出致命错误:找不到“ numpy / arrayobject.h”文件 - cimport gives fatal error: 'numpy/arrayobject.h' file not found 如何解决这个致命错误:numpy/arrayobject.h:没有这样的文件或目录? - How do I resolve this make fatal error: numpy/arrayobject.h: No such file or directory? Cython:致命错误:未找到“numpy/arrayobject.h”文件,使用 numpy - Cython: fatal error: 'numpy/arrayobject.h' file not found, using numpy 相当于使用#include <Numeric/arrayobject.h> 在Numpy - equivalent of using #include <Numeric/arrayobject.h> in Numpy 编译.pyx文件时缺少numpy / arrayobject.h - Missing numpy/arrayobject.h while compiling .pyx file 致命错误:使用 pyenv 时找不到“arrayobject.h”文件 - fatal error: 'arrayobject.h' file not found when using pyenv 将 numpy 的 arrayobject.h 包含到 bitbake 配方中 - 如何修复安装顺序? - Include numpy's arrayobject.h into bitbake recipe - how to fix installation order? 在Windows中编译SWIG python包装程序时,MinGW g ++找不到numpy \\ arrayobject.h - numpy\arrayobject.h not find by MinGW g++ while compiling SWIG python wrapper in Windows
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM