python-3.xpandasdataframedebuggingspyder

Error: "Spyder was unable to retrieve the value of this variable" after updating pandas to 1.4.0, how to solve it?


Not sure if this is a common problem with Spyder after manually updating a package from cmd but, in my case, I updated Pandas package to 1.4.0 with cmd, before that everything was working perfectly, but after doing so, my Spyder environment threw the following error when trying to display a simple df:

enter image description here

The code I ran was:

import pandas as pd

#column names
column_names = ["Time", "Currency", "Volatility expected", "Event", "Actual", "Forecast", "Previous"]

#create a dataframe including the column names
df = pd.DataFrame(columns=column_names)

It's important to mention that if I type df in the spyder console, I DO get the information stored in the df variable:

enter image description here

My only problem is that I can't see the details of that df when I click it in the Variable Explorer


Solution

  • It seems that my issue will be solved at the end of this month.

    So, I had to downgrade my Pandas package to 1.3.5 version using pip install -Iv --user pandas==1.3.5 on cmd, and conda install pandas==1.3.5 on my miniconda3 environment.

    After that, my variable explorer ran smoothly:

    solucionado