-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
ImportError: Numerical Python (NumPy) is not installed. #5904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Try |
< 8000 details-menu class="dropdown-menu dropdown-menu-sw show-more-popover color-fg-default" style="width:185px" src="" preload >
@napsternxg Please post in Pip issues. https://github.com/pypa/pip/issues |
Appartently the setup.py of scikit-learn fails to import numpy. I do not |
@GaelVaroquaux How to determine if the pip and python are from same python install ? Here is all I could find:
Also, I can find Also,
|
If you look at your earlier traceback, you'll see that pip is most likely This is very, very strange. I tried installing scikit-learn 0.17 with pip |
Since you are running pip with elevated privileges ( |
Since you are running pip with elevated privileges (sudo pip) for installing
scikit-learn, but check for numpy without sudo, I think numpy may not have been
installed for root? (just a wild guess)
Good idea. Could you check the imports when running as root.
|
Already did that.
|
Ok could you try this? (sorry I am just curious ;))
|
@napsternxg what're in |
@rvraghav93 I don't have permissions to run python as sudo so can't present some of the results in your script. But this is ourput from what I can run with my current permissions.
Some extra information which I can provide about the sudo and non sudo versions of pip are the following: Using
Using
|
Could that be the reason? (since Also any specific reason why you don't do |
@rvraghav93
And here is for
|
Ah! Try this? $ sudo chown -R username:username /usr/local/lib/python2.7/
$ pip install --upgrade scikit-learn I think this should work (assuming you are able to run |
@rvraghav93 sorry don't have privileges for running chown. Also can you edit your last comment to remove my username from it. Thanks. |
BTW I also ran the following command which ensures that Numpy is indeed installed for root python as shown below:
|
Some more information: I wrote a small package of my own with similar numpy check as the one used in Sklearn. My setup.py file looks like the following:
When I install the following using
I do believe it is some issue on my side and not with sklearn. I will investigate more and will post here if I find any issues. I will close the issue for the time being. |
👍 good luck :) |
Fixed this issue by:
|
I do believe it is some issue on my side and not with sklearn. I will
investigate more and will post here if I find any issues. I will close the
issue for the time being.
Please do report your conclusions here, however, so that we learn a bit
the kind of problems our users have.
|
1. Uninstalling numpy
2. Adding openblas.conf in /etc/ld.so.conf.d/
3. Installing numpy
4. Install other packages like scipy and scikit-learn.
I really don't understand a thing. Maybe it's because the installs of
numpy that you had were missing a .egg-info? It used to be that installs
of numpy via Linux distributions didn't play well with Python packaging
tools. But I thought that this was mostly over.
|
I was having similar trouble today and noticed a potential problem with sklearn's setup.py. According to python setuptool docs you need to include the |
There are arguments both ways. Look at #4164 (comment) and related issues/PRs for example about why we decided to do it this way. |
I am trying to upgrade my sklearn from version 0.16.1 to the latest using pip however the
sudo pip install sklearn --upgrade
command fails with the following message:I already have numpy 1.10.1 installed as found in
My pip version is also up to date
I manually installed numpy from source using OpenBLAS 0.2.16.dev using the pip command from the source directory.
The text was updated successfully, but these errors were encountered: