undefined symbol: cblas_sgemm
See original GitHub issueThis is on installing numpy on raspberry pi 3. I used the Noobs latest version and so using Raspbian stretch. Python was already installed, and I think numpy was already included. At the time, I think that import numpy was working well. I installed openCV and it didn’t work for a while as I had not put some necessary modules, but finally got it to work. So far so good. Later I was trying to install matplotlib, and this didn’t go very smoothly. I made a number of attempts where the message in the title was already flagged. I finally manage to get the import matplotlib to work, but then numpy stopped importing. Now I cannot import either matplotlib or numpy, despite having uninstalled numpy (pip3 uninstall numpy) and reinstalled:
/home/pi/.local/lib/python3.5/site-packages/numpy/tests/test_warnings.py /home/pi/.local/lib/python3.5/site-packages/numpy/version.py Proceed (y/n)? y Successfully uninstalled numpy-1.16.1 pi@raspberrypi:~ $ pip3 install numpy Collecting numpy Using cached https://www.piwheels.org/simple/numpy/numpy-1.16.1-cp35-cp35m-linux_armv7l.whl Installing collected packages: numpy Successfully installed numpy-1.16.1 pi@raspberrypi:~ $
Prior to uninstalling numpy, I did try to install without uninstalling, and downloaded the cached file mentioned.
Now, I cannot import numpy or matplotlib and for both get a similar error and the message telling me to raise this new issue which I am doing now.
import numpy Traceback (most recent call last): File “/home/pi/.local/lib/python3.5/site-packages/numpy/core/init.py”, line 16, in <module> from . import multiarray File “/home/pi/.local/lib/python3.5/site-packages/numpy/core/multiarray.py”, line 12, in <module> from . import overrides File “/home/pi/.local/lib/python3.5/site-packages/numpy/core/overrides.py”, line 6, in <module> from numpy.core._multiarray_umath import ( ImportError: /home/pi/.local/lib/python3.5/site-packages/numpy/core/_multiarray_umath.cpython-35m-arm-linux-gnueabihf.so: undefined symbol: cblas_sgemm
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File “<pyshell#0>”, line 1, in <module> import numpy File “/home/pi/.local/lib/python3.5/site-packages/numpy/init.py”, line 142, in <module> from . import core File “/home/pi/.local/lib/python3.5/site-packages/numpy/core/init.py”, line 47, in <module> raise ImportError(msg) ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the multiarray numpy extension module failed. Most likely you are trying to import a failed build of numpy. Here is how to proceed:
- If you’re working with a numpy git repository, try
git clean -xdf
(removes all files not under version control) and rebuild numpy. - If you are simply trying to use the numpy version that you have installed: your installation is broken - please reinstall numpy.
- If you have already reinstalled and that did not fix the problem, then:
-
Check that you are using the Python you expect (you’re using /usr/bin/python3), and that you have no directories in your PATH or PYTHONPATH that can interfere with the Python and numpy versions you’re trying to use.
-
If (1) looks fine, you can open a new issue at https://github.com/numpy/numpy/issues. Please include details on:
- how you installed Python
- how you installed numpy
- your operating system
- whether or not you have multiple versions of Python installed
- if you built from source, your compiler versions and ideally a build log
Note: this error has many possible causes, so please don’t comment on an existing issue about this - open a new one instead.
-
Original error was: /home/pi/.local/lib/python3.5/site-packages/numpy/core/_multiarray_umath.cpython-35m-arm-linux-gnueabihf.so: undefined symbol: cblas_sgemm
import matplotlib Traceback (most recent call last): File “/home/pi/.local/lib/python3.5/site-packages/numpy/core/init.py”, line 16, in <module> from . import multiarray File “/home/pi/.local/lib/python3.5/site-packages/numpy/core/multiarray.py”, line 12, in <module> from . import overrides File “/home/pi/.local/lib/python3.5/site-packages/numpy/core/overrides.py”, line 6, in <module> from numpy.core._multiarray_umath import ( ImportError: /home/pi/.local/lib/python3.5/site-packages/numpy/core/_multiarray_umath.cpython-35m-arm-linux-gnueabihf.so: undefined symbol: cblas_sgemm
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File “<pyshell#1>”, line 1, in <module> import matplotlib File “/home/pi/.local/lib/python3.5/site-packages/matplotlib/init.py”, line 141, in <module> from . import cbook, rcsetup File “/home/pi/.local/lib/python3.5/site-packages/matplotlib/cbook/init.py”, line 33, in <module> import numpy as np File “/home/pi/.local/lib/python3.5/site-packages/numpy/init.py”, line 142, in <module> from . import core File “/home/pi/.local/lib/python3.5/site-packages/numpy/core/init.py”, line 47, in <module> raise ImportError(msg) ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the multiarray numpy extension module failed. Most likely you are trying to import a failed build of numpy. Here is how to proceed:
- If you’re working with a numpy git repository, try
git clean -xdf
(removes all files not under version control) and rebuild numpy. - If you are simply trying to use the numpy version that you have installed: your installation is broken - please reinstall numpy.
- If you have already reinstalled and that did not fix the problem, then:
-
Check that you are using the Python you expect (you’re using /usr/bin/python3), and that you have no directories in your PATH or PYTHONPATH that can interfere with the Python and numpy versions you’re trying to use.
-
If (1) looks fine, you can open a new issue at https://github.com/numpy/numpy/issues. Please include details on:
- how you installed Python
- how you installed numpy
- your operating system
- whether or not you have multiple versions of Python installed
- if you built from source, your compiler versions and ideally a build log
Note: this error has many possible causes, so please don’t comment on an existing issue about this - open a new one instead.
-
Original error was: /home/pi/.local/lib/python3.5/site-packages/numpy/core/_multiarray_umath.cpython-35m-arm-linux-gnueabihf.so: undefined symbol: cblas_sgemm
I hope this helps and that it will eventually contribute to making the installation of these two packages easier in the future.
Thanks,
Thomas
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (3 by maintainers)
Maybe you can try the following commands:
It fixes my issue.
This issue is closed. I am closing discussion here so that people will open a new issue instead of commenting here.