sminterpolate icon indicating copy to clipboard operation
sminterpolate copied to clipboard

Installation error with numpy

Open TonyTash opened this issue 6 years ago • 2 comments

When I try installing using python2 on Arch Linux (manually or through aur), I get the following error. I have tried installing numpy for python 2 and 3, through pip and through pacman.

running install running bdist_egg running egg_info writing butterflow.egg-info/PKG-INFO writing top-level names to butterflow.egg-info/top_level.txt writing dependency_links to butterflow.egg-info/dependency_links.txt writing entry points to butterflow.egg-info/entry_points.txt reading manifest file 'butterflow.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching '*.pyc' found under directory 'tests' writing manifest file 'butterflow.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py running build_ext building 'butterflow.motion' extension gcc -pthread -fno-strict-aliasing -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt DNDEBUG -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -fPIC -I/home /tony/Software/butterflow/depends/opencv-ndarray-conversion/include -I/usr/include/python2.7 -c /home/tony/Software/butterflow/butterflow/motion.cpp -o build/temp.linux-x86_64-2.7/home/tony/Software /butterflow/butterflow/motion.o -Wno-unused-variable -Wno-unused-function -Wno-cpp In file included from /home/tony/Software/butterflow/butterflow/motion.cpp:7: /home/tony/Software/butterflow/depends/opencv-ndarray-conversion/include/opencv-ndarray-conversion /conversion.h:8:10: fatal error: numpy/ndarrayobject.h: No such file or directory #include <numpy/ndarrayobject.h> ^~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. error: command 'gcc' failed with exit status 1

Meanwhile, installing using python3 results in a different error: https://gist.github.com/TonyTash/c3fef8ade3da1e388d3245290fdd7e30

I also tried installing it on a Debian server, and the install worked, but I get the following error running butterflow:

free(): invalid pointer Aborted

TonyTash avatar Nov 09 '18 05:11 TonyTash

I am getting the same errors as you when I run setup.py with python 2 and python 3.

l0ophole avatar Sep 23 '19 03:09 l0ophole

I got it to compile. There may be a better way to do this, but this is what I did:

$ find / -name 'ndarrayobject.h' -print

When it finds the path to the python2 version, hit Ctrl+C to kill find. Mine was located at:

/usr/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h

Copy that path to your clipboard to be pasted into a header file in the next step.

Open the header file in nano(or the text editor of your choice):

$ nano ~/git/butterflow/depends/opencv-ndarray-conversion/include/opencv-ndarray-conversion/conversion.h

On my computer I checked the project out into ~/git, so change that with wherever you checked out the project on your computer.

Delete this line: #include <numpy/ndarrayobject.h>

And replace it with this, changing the path, if necessary, to the one that was found with the find command above(it should already be copied into in your clipboard):

#include "/usr/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h"

Save the file and exit nano. Run setup.py again with python2 and it should make it all the way through now.

l0ophole avatar Sep 23 '19 03:09 l0ophole