Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

Problem with import root_numpy #315

Closed
vlisovsk opened this issue May 13, 2017 · 5 comments
Closed

Problem with import root_numpy #315

vlisovsk opened this issue May 13, 2017 · 5 comments

Comments

@vlisovsk
Copy link

vlisovsk commented May 13, 2017

Hello, I have the ROOT 5.34/34 installed some time ago from Homebrew. Now I need to install the root_numpy. I do it via
pip install root_numpy
Then I try to import root_numpy in python and get this error:

import root_numpy
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/Cellar/root/5.34.34_1/lib/root/ROOT.py", line 352, in _importhook
return _orig_ihook( name, *args, **kwds )
File "/usr/local/lib/python2.7/site-packages/root_numpy/init.py", line 51, in
from ._tree import (
File "/usr/local/Cellar/root/5.34.34_1/lib/root/ROOT.py", line 352, in _importhook
return _orig_ihook( name, *args, **kwds )
File "/usr/local/lib/python2.7/site-packages/root_numpy/_tree.py", line 6, in
from . import _librootnumpy
File "/usr/local/Cellar/root/5.34.34_1/lib/root/ROOT.py", line 352, in _importhook
return _orig_ihook( name, *args, **kwds )
File "root_numpy/src/setup.pxi", line 5, in init _librootnumpy (root_numpy/src/_librootnumpy.cpp:5)
File "init.pxd", line 989, in numpy.import_array (root_numpy/src/_librootnumpy.cpp:989)
ImportError: numpy.core.multiarray failed to import

At the same time, import ROOT works fine.
I checked that numpy is latest version 1.12.1 and even reinstalled it again, import numpy works fine.
Python has version 2.7.11.
Does anyone has an idea how to solve this issue?

@kratsg
Copy link
Collaborator

kratsg commented May 13, 2017

Please update your numpy installation:

pip install --upgrade numpy

Your numpy version is too old and does not contain the numpy.core.multiarray library.

@ndawe - we should probably add a min-version requirement?

@vlisovsk
Copy link
Author

vlisovsk commented May 13, 2017

When I do pip install --upgrade numpy, it says

Requirement already up-to-date: numpy in /usr/local/lib/python2.7/site-packages

I also tried pip install numpy --upgrade --ignore-installed but importing root_numpy still does not work.

Upd:
Also, if i type in python import numpy.core.multiarray, this gives no error. But importing root_numpy still does not work.

@kratsg
Copy link
Collaborator

kratsg commented May 13, 2017

Try:

pip uninstall numpy root_numpy

and then

pip install --upgrade --ignore-installed --no-cache-dir numpy root_numpy

@vlisovsk
Copy link
Author

Thanks a lot, it seems this solved the issue!

@ndawe
Copy link
Member

ndawe commented May 13, 2017

Thanks @kratsg! Fast response as usual...

@ndawe ndawe closed this as completed May 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants