I'm using Raspberry 4 to host a web service with FastAPI. In my code, there's a dependency on Pandas. When I ran the web service, it gives me the error message below:
File "/home/pi/Projects/mouse_bot/venv/lib/python3.9/site-packages/china_idiom/__init__.py", line 36, in <module>
from china_idiom.core import *
File "/home/pi/Projects/mouse_bot/venv/lib/python3.9/site-packages/china_idiom/core.py", line 9, in <module>
import pandas as pd
File "/home/pi/Projects/mouse_bot/venv/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 "/home/pi/Projects/mouse_bot/venv/bin/python3.9"
* The NumPy version is: "1.21.1"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: /lib/arm-linux-gnueabihf/libm.so.6: version `GLIBC_2.29' not found (required by /home/pi/Projects/mouse_bot/venv/lib/python3.9/site-packages/numpy/core/_multiarray_umath.cpython-39-arm-linux-gnueabihf.so)
I followed the link in the error message, and ran these:
sudo apt-get install libatlas-base-dev
sudo apt-get install python-dev libatlas-base-dev
It still gives me the same error message.
I tried uninstalling NumPy and use apt install python3-numpy
to install again, but the system just tells me NumPy doesn't exists this time.