TensorFlow-Lite-Object-Detection-on-Android-and-Raspberry-Pi icon indicating copy to clipboard operation
TensorFlow-Lite-Object-Detection-on-Android-and-Raspberry-Pi copied to clipboard

ImportError: libopenblas.so.0: cannot open shared object file: No such file or directory

Open SaranRavella123 opened this issue 2 years ago • 1 comments
trafficstars

Hello. I'm very new to this and I watched your video on how to use raspberrypi to do object detection. Everything went smoothly, except in the end I'm having trouble because I don't know how to resolve this error.

(tflite1-env) saran@welcomegateiot:~/tflite1 $ python3 TFLite_detection_webcam.py --modeldir=Sample_TFLite_model Traceback (most recent call last): File "/home/saran/tflite1/tflite1-env/lib/python3.9/site-packages/numpy/core/init.py", line 24, in from . import multiarray File "/home/saran/tflite1/tflite1-env/lib/python3.9/site-packages/numpy/core/multiarray.py", line 10, in from . import overrides File "/home/saran/tflite1/tflite1-env/lib/python3.9/site-packages/numpy/core/overrides.py", line 8, in from numpy.core._multiarray_umath import ( ImportError: libopenblas.so.0: 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 "/home/saran/tflite1/tflite1-env/lib/python3.9/site-packages/numpy/init.py", line 130, in from numpy.config import show as show_config File "/home/saran/tflite1/tflite1-env/lib/python3.9/site-packages/numpy/config.py", line 4, in from numpy.core._multiarray_umath import ( File "/home/saran/tflite1/tflite1-env/lib/python3.9/site-packages/numpy/core/init.py", line 50, in raise ImportError(msg) ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for many reasons, often due to issues with your setup or how NumPy was installed.

We have compiled some common reasons and troubleshooting tips at:

https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  • The Python version is: Python3.9 from "/home/saran/tflite1/tflite1-env/bin/python3"
  • The NumPy version is: "1.26.0"

and make sure that they are the versions you expect. Please carefully study the documentation linked above for further help.

Original error was: libopenblas.so.0: cannot open shared object file: No such file or directory

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/saran/tflite1/tflite1-env/lib/python3.9/site-packages/numpy/init.py", line 135, in raise ImportError(msg) from e ImportError: Error importing numpy: you should not try to import numpy from its source directory; please exit the numpy source tree, and relaunch your python interpreter from there. Traceback (most recent call last): File "/home/saran/tflite1/TFLite_detection_webcam.py", line 19, in import cv2 File "/home/saran/tflite1/tflite1-env/lib/python3.9/site-packages/cv2/init.py", line 5, in from .cv2 import * ImportError: numpy.core.multiarray failed to import

SaranRavella123 avatar Oct 06 '23 08:10 SaranRavella123

I was getting the same error (up to date Bullseye on a Pi4). Try

sudo apt install libopenblas-base libopenblas-dev

which resolved the python error for me.

theprotector avatar Dec 04 '23 16:12 theprotector