问题
When I try to click on data frames in the Variable Explorer in Spyder, I get the following error:
This happens with all data frames (I tried making my own).
As a side note, functions like numpy.sum
and .describe()
don't output anything, but I'm unsure if this is related to the KeyError.
Thank you!
回答1:
Add pandas to the packages option in setup.py
module.
Here is the code snippet for setup.py
from setuptools import setup
APP = ['automating_finances0.py']
DATA_FILES = []
OPTIONS = {'packages': ['pandas']}
setup(
app=APP,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
)
If this not works please try reinstalling pandas from pip as
pip uninstall pandas
pip install pandas
来源:https://stackoverflow.com/questions/66022547/keyerrorpandas-libs-interval-when-opening-a-dataframe-in-spyder