I have a Raspberry Pi box with Python 3.7.3 and I'm trying to create a pie chart, and in what is becoming a rather all too regular occurrence, I have failed at the very first step. But each time I fall, I'm learning loads.
My script contains the following import:
import plotly.express as px
and I get this when trying to run the .py script
import plotly.express as px
File "/home/pi/.local/lib/python3.7/site-packages/plotly/express/__init__.py", line 12, in <module>
Plotly express requires pandas to be installed."""
ImportError: Plotly express requires pandas to be installed.
But I have pandas installed and if I run:
pip show pandas
I get this:
pip show pandas
Name: pandas
Version: 1.3.4
Summary: Powerful data structures for data analysis, time series, and statistics
Home-page: https://pandas.pydata.org
Author: The Pandas Development Team
Author-email: pandas-dev@python.org
License: BSD-3-Clause
Location: /home/pi/.local/lib/python3.7/site-packages
Requires: python-dateutil, numpy, pytz
Required-by:
So to my little brain, this says I have pandas installed but obviously something is amiss here.
I've seen this similar question: ImportError: Plotly express requires pandas to be installed
Which states:
"Pandas is a dependency that is only used in plotly.express not in plotly. For more you can visit this issue. So you need to install pandas using pip install pandas"
and the link to the githib states (https://github.com/plotly/plotly.py/issues/2279):
"pandas is only an optional dependency which is used in plotly.express only."
Any advice is gratefully received. I'm itching to display some of my data in a chart.
Thanks.
EDIT
In response to Rob's comment I have created a new file containing just:
import pandas as pd
print(pd.__version__)
import plotly
print(plotly.__version__)
and this is what I get:
pi@raspberrypi:~/Python $ python panda-test.py
Traceback (most recent call last):
File "panda-test.py", line 1, in <module>
import pandas as pd
File "/home/pi/.local/lib/python3.7/site-packages/pandas/__init__.py", line 17, in <module>
"Unable to import required dependencies:\n" + "\n".join(missing_dependencies)
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.7 from "/usr/bin/python3"
* The NumPy version is: "1.21.4"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: libf77blas.so.3: cannot open shared object file: No such file or directory