Numpy: libf77blas.so.3: cannot open shared file: no such file or directory

Created on 24 Oct 2019  ·  15Comments  ·  Source: numpy/numpy

-Operating System: Raspbian Stretch (9)
-How Python was installed: Python 3.5.3 is default Python3 on Stretch
-How numpy was installed: pip installed under virtual environment (version 1.17.3)
-Python2.7 is also installed by default

I want to use OpenVINO's dldt library for inference on raspberry pi 3. I've run into issues before but following some instructions here, I built the most recent version of the library using cmake for native compilation under raspbian stretch (It took hours).

I first noticed the error when running their model optimizer python code:

$ python3 <dldt_dir>/model-optimizer/mo.py --input_model [input model] --data_type [data type] --output_dir [output_dir]
Traceback (most recent call last):
  File "/home/pi/.virtualenvs/openvino/lib/python3.5/site-packages/numpy/core/__init__.py", line 17, in <module>
    from . import multiarray
  File "/home/pi/.virtualenvs/openvino/lib/python3.5/site-packages/numpy/core/multiarray.py", line 14, in <module>
    from . import overrides
  File "/home/pi/.virtualenvs/openvino/lib/python3.5/site-packages/numpy/core/overrides.py", line 7, in <module>
    from numpy.core._multiarray_umath import (
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 "/home/pi/.virtualenvs/openvino/lib/python3.5/site-packages/numpy/__init__.py", line 142, in <module>
    from . import core
  File "/home/pi/.virtualenvs/openvino/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 numpy c-extensions failed.
- Try uninstalling and reinstalling numpy.
- If you have already done that, then:
  1. Check that you expected to use Python3.5 from "/home/pi/.virtualenvs/openvino/bin/python",
     and that you have no directories in your PATH or PYTHONPATH that can
     interfere with the Python and numpy version "1.17.3" 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

- If you're working with a numpy git repository, try `git clean -xdf`
  (removes all files not under version control) and rebuild numpy.

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: libf77blas.so.3: cannot open shared object file: No such file or directory

However I quickly found out that this problem persists when importing numpy from Python3

>>> import numpy as np
[...]
Importing the numpy c-extensions failed.
[...]
Original error was: libf77blas.so.3: cannot open shared object file: No such file or directory

I've tried uninstalling and reinstalling numpy. I've made sure that numpy worked in Python3 before installing the dldt library.
Please help. You're my only hope.

32 - Installation

Most helpful comment

Looking at gh-11110, perhaps this would solve the problem?

sudo apt-get install libatlas-base-dev

All 15 comments

Looking at gh-11110, perhaps this would solve the problem?

sudo apt-get install libatlas-base-dev

Closing, in the hopes that the suggested solution solved the problem and the original reporter now can use NumPy. If that is not the case, please reopen with more information or open a new issue explaining why this is not a duplicate

Ran into the same problem today.

Came here to confirm that the proposed solution (sudo apt-get install libatlas-base-dev) worked for me.

Thanks!

Me too, the solution works. Thank you so much!

work for me too, thanks

fixed for me too.

sudo apt-get install libatlas-base-dev worked for me too. Thanks.

Work!

Can someone explain why installing this additional package works?

NumPy uses OpenBLAS to do its heavy linalg work, that means NumPy calls out into a shared object provided by a third party package. The official NumPy wheels on PyPI incorporate that other package into the wheel and ship the whole thing together. The wheels provided by the https://www.piwheels.org people do not: they depend on you installing the OpenBLAS package separately. So if you get NumPy from them, you need to install the package.

I am here confirm that sudo apt-get install libatlas-base-dev worked for me as well. Thank you !

NumPy uses OpenBLAS to do its heavy linalg work, that means NumPy calls out into a shared object provided by a third party package. The official NumPy wheels on PyPI incorporate that other package into the wheel and ship the whole thing together. The wheels provided by the https://www.piwheels.org people do not: they depend on you installing the OpenBLAS package separately. So if you get NumPy from them, you need to install the package.

thanks

I can confirm, that worked for me as well.

worked for me as well. thanks

worked for me too, thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Levstyle picture Levstyle  ·  3Comments

marcocaccin picture marcocaccin  ·  4Comments

dmvianna picture dmvianna  ·  4Comments

Kreol64 picture Kreol64  ·  3Comments

amuresan picture amuresan  ·  4Comments