Reputation: 775
When I try to import numpy in Python3 i get an error.
I installed it via pip3 and it got installed succesfully.
sudo pip3 install numpy
Here is the error message when i try to import numpy:
Python 3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/numpy/core/__init__.py", line 16, in <module>
from . import multiarray
ImportError: libf77blas.so.3: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.5/dist-packages/numpy/__init__.py", line 142, in <module>
from . import add_newdocs
File "/usr/local/lib/python3.5/dist-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/usr/local/lib/python3.5/dist-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/usr/local/lib/python3.5/dist-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/usr/local/lib/python3.5/dist-packages/numpy/core/__init__.py", line 26, in <module>
raise ImportError(msg)
ImportError:
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control). Otherwise reinstall numpy.
Original error was: libf77blas.so.3: cannot open shared object file: No such file or directory
Upvotes: 28
Views: 21161
Reputation: 150
Installing libatlas-base-dev
did not work for me.
Installing numpy==1.15.1
did.
Upvotes: 0
Reputation: 79
I am going to add an answer as I don't have enough reputation to comment.
I had this issue on my Raspberry Pi 4.
In my case this was fixed simply by running this in the command line:
sudo apt-get install libatlas-base-dev
I thought initially I was missing a python module dependency, but this is a unix dependency, its shouldn't affect you python virtual environment
Upvotes: 3
Reputation: 2450
Moving my comment to an answer because it seemed helpful to a few users.
You are missing a core numpy
dependency. Running
sudo apt-get install python-dev libatlas-base-dev
should fix the problem.
If that doesn't work, you can try installing RPi specific versions of numpy
, see comments here.
Upvotes: 63