can't open dataframe in variable explorer in Spyder IDE

Viewed 2356

Due to Anaconda didn't support free for commercial use. So I downloaded Spyder IDE from Spyder official website. Spyder official web Since Spyder IDE doesn't provide a function for users to download libraries as PIP install. But I still love Spyder's UI and some functions, especially, variable explore, etc... So I installed official python on my PC, taking Spyder IDE as a code editor. <-- It can work by changing the python interpreter in the Spyder preference setting. change Spyder's setting to apply official Python

But I found an error when I try to open a variable (which is dataframe) on variable explorer, others are work well. enter image description here

enter image description here

from pandas import DataFrame

People_List = ['Jon','Mark','Maria','Jill','Jack']

df = DataFrame (People_List,columns=['First_Name'])

print (df)
2 Answers

I got the same error and I noticed that I only got it after I created GeoDataFrames from the Geopandas library. Once I restarted Spyder, as long as I don't create a GeoDataFrame, it opens all other DataFrames (from Pandas) just fine.

I had the same issue and setup (windows 10, trying to install and get geopandas to work, but then couldn't get dataframes to be viewed in spyder). Ultimately, running pip install spyder in the new python that I was trying to use in spyder fixed the problem.

However, I think probably switching to an anaconda-based python interpreter in spyder, and installing geopandas and spyder-kernels through conda, would be a better long-term approach. This also has worked for me (I think I have become confused between pip and conda, e.g. this answer re: geopandas asks for pip https://stackoverflow.com/a/58943939/5233269, but conda can also install geopandas -- and most importantly deal with all the dependencies involved. I think conda is probably better long-run for data work.)

Related