2

hello i am trying to run a git repo in google colab, i installed all requirements as per the git instruction

while running the certain file i am getting this error

fatal error: numpy/arrayobject.h: No such file or directory
#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

the command i ran in google colab was

     !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

    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
1

1 Answer 1

1

I had a similar problem and I solved it by editing 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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.