1

I have installed numpy but shell says it is not installed. I have multiple python3 versions installed. I know it has to do something to point to the correct path, but I don't know how to do it. Both python3 and pip3 points python 3.6. I don't understand what the problem could be?

These may be helpful:

$ where python3                  
/home/subtleseeker/miniconda3/bin/python3
/usr/bin/python3
/usr/bin/python3

$ whereis python3
python3: /usr/bin/python3.6m 
/usr/bin/python3.6-config 
/usr/bin/python3 
/usr/bin/python3.6m-config 
/usr/bin/python3.6 
/usr/lib/x86_64-linux-gnu/python3.6 
/usr/lib/python3.7 
/usr/lib/python3 
/usr/lib/python3.6 
/etc/python3 
/etc/python3.6 
/usr/local/bin/python3.4m-config 
/usr/local/bin/python3.4 
/usr/local/bin/python3.4m 
/usr/local/lib/python3.4 
/usr/local/lib/python3.6 
/usr/include/python3.6m 
/usr/include/python3.6 
/usr/share/python3 
/home/subtleseeker/miniconda3/bin/python3.6m 
/home/subtleseeker/miniconda3/bin/python3.6-config 
/home/subtleseeker/miniconda3/bin/python3 
/home/subtleseeker/miniconda3/bin/python3.6m-
/home/subtleseeker/miniconda3/bin/
/usr/share/man/man1/python3.1.gz

$ pip3 --version
pip 18.0 from /usr/local/lib/python3.6/dist-packages/pip (python 3.6)

$ python3 --version
Python 3.6.5 :: Anaconda, Inc.

>>> import sys
>>> print(sys.path)
['', '/home/subtleseeker/miniconda3/lib/python36.zip', '/home/subtleseeker/miniconda3/lib/python3.6', '/home/subtleseeker/miniconda3/lib/python3.6/lib-dynload', '/home/subtleseeker/.local/lib/python3.6/site-packages', '/home/subtleseeker/miniconda3/lib/python3.6/site-packages']

The problem started when I installed miniconda. BTW I already had anaconda installed.

1 Answer 1

2

Have you already made sure that numpy is really installed with the python version you are using? You can do this with

$ [path_to_your_used_python_version] -m pip show numpy

If it is not installed, you can install it with

$ [path_to_your_used_python_version] -m pip install numpy
Sign up to request clarification or add additional context in comments.

4 Comments

Great! It did work. Could you explain where the version difference was coming and how to find that specific version? Any more info needed to find it? Do python3.6.5 and pip3.6 points to different places?
Pip is just a module like any other. It has to be installed for every Python version (2.x, 3.x) but also for special python installations, like anaconda etc.. Since you have installed python once natively and once via anaconda, you also need the module "numpy" in both installations. If my answer helped you, you can mark it as accepted.
So, if I removed miniconda (which I installed after which the error started), would that lead back python using the previously installed modules?
Well possible, but only because there is only one Python version left. If you have several python versions installed (Python3 native and by Anaconda, you also have to install the modules separately, they are stored separately for each Python version. For example, in my case /usr/local/lib/<your-python-version>/dist-packages.

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.