question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

undefined symbol: cblas_sgemm

See original GitHub issue

This 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:
    1. 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.

    2. 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:
    1. 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.

    2. 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:closed
  • Created 5 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
skyroamcommented, Nov 13, 2019

Maybe you can try the following commands:

#sudo apt-get remove python-numpy
sudo apt-get remove python3-numpy
pip3 uninstall numpy
sudo apt-get install python3-numpy

It fixes my issue.

0reactions
mattipcommented, Mar 2, 2021

This issue is closed. I am closing discussion here so that people will open a new issue instead of commenting here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Undefined symbol: cblas_dgemm - Hail Query & hailctl
Hi! I get the following error when I execute pipelines including linear_regression_rows: /usr/java/default/bin/java: symbol lookup error: /.
Read more >
cblas linking: undefined reference to `cblas_dgemv' [duplicate]
Closed 6 years ago. I am trying to use cblas library to use BLAS. I call cblas function from a custom C function...
Read more >
undefined reference file cblas_dgemm · Issue #2204 - GitHub
I try to create a simple test using the OpenBLAS library. (Call CBLAS Interface). I previously created the following directories
Read more >
[SOLVED] Attempting my first PKGBUILD, error on undefined ...
I'm thinking my first angle of attack will probably be to somehow find which go dependency relies on that implicit cblas symbols via...
Read more >
Compilation error: undefined reference to 'cblas_dgemv ...
I am trying to run example code from https://tour.dlang.org/tour/en/dub/lubeck example.d: --- /+dub.sdl: dependency "lubeck" version="~>1.1" ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found