I use raspberrypi 4 ; 32 bit, linux run python
error occur:
ImportError: Unable to import required dependencies: numpy
Original error was: libcblas.so.3: cannot open shared object file: No such file or directory
I find the solution link: https://github.com/numpy/numpy/issues/15090
I haven't solve yet.
below I did Try uninstalling
and reinstalling numpy
to solve
joy@raspberrypi:/ $ python --version
Python 3.9.2
joy@raspberrypi:/ $ python3 --version
Python 3.9.2
joy@raspberrypi:/media/joy/DATA $ pip uninstall numpy
Found existing installation: numpy 1.19.5
Not uninstalling numpy at /usr/lib/python3/dist-packages, outside environment /usr
Can't uninstall 'numpy'. No files were found to uninstall.
joy@raspberrypi:/media/joy/DATA $ pip install --upgrade numpy
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (1.19.5)
Collecting numpy
Using cached https://www.piwheels.org/simple/numpy/numpy-1.23.4-cp39-cp39-linux_armv7l.whl (12.4 MB)
Installing collected packages: numpy
WARNING: The scripts f2py, f2py3 and f2py3.9 are installed in '/home/joy/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed numpy-1.23.4
- but when I run python script with import
pandas
andpymongo
(the main correct script) still cannot run, somewhere setting inside raspberrypi is wired I assume
Traceback (most recent call last):
File "/media/joy/DATA/excel_to_mDB.py", line 3, in <module>
import pandas as pd
File "/home/joy/.local/lib/python3.9/site-packages/pandas/__init__.py", line 16, in <module>
raise ImportError(
ImportError: Unable to import required dependencies:
numpy:
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 "/usr/bin/python"
* The NumPy version is: "1.23.4"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: libcblas.so.3: cannot open shared object file: No such file or directory
in case someone want to see the whole script( code is correct, that I can run on normal linux computer, just have some setting error on raspberry pi 4)
import pandas as pd
from pymongo import MongoClient
aaa = pd.read_excel("T1_new.xls")
print(aaa.head)
client = MongoClient('127.0.0.1:27017')
db = client['sample_data_in_DB']
collection = db['sample_collection']
collection.insert_many(aaa.to_dict('records'))