Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spyder was unable to retrieve the value depends on how module is imported #15998

Open
9 of 10 tasks
thunderbolt-tom opened this issue Jul 9, 2021 · 35 comments
Open
9 of 10 tasks

Comments

@thunderbolt-tom
Copy link

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Reset preferences with spyder --reset
    • Reinstalled the latest version of Anaconda
    • Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

In the variable explorer I get the error message "Spyder was unable to retrieve the value of this variable from the console." when double clicking on a class instance, but only when the module containing the class is imported in certain ways. When imported in other ways the same class will display as expected.

Furthermore, there seems to be an oddity where the error will show for a class when first run, yet when the same script is run again the variable will sometimes display as expected.

Specifically this seems to occur if a module is imported from outside the directory tree in which the main python script is located after adding a folder to the path using sys.path.append().

I've tested this on Windows on an Anaconda installation and on Linux using a miniconda installation and get exactly the same behaviour in both situations.

The error message shown in the error popup is " The Error message was: An error occurred, see the console..." however there is no error or traceback in the console.

What steps reproduce the problem?

Consider the following folder structure (I've attached a zip file with these file included):
spyder_import.zip

/home/tom/spyder_import
|--testclass_folder
|  |--testclass_outside.py
|--testscript_folder
|  |--testscript.py
|  |--testclass_subfolder
|     |--testclass_inside.py

Where testclass_outside.py and testclass_inside.py contain identical class definitions (except varying names):

testclass_inside.py:

class tc_inside():
    def __init__(self):
        self.var = 123
    
    def printvar(self):
        print(self.var)

testclass_outside.py:

class tc_outside():
    def __init__(self):
        self.var = 123
    
    def printvar(self):
        print(self.var)

testscript.py imports these two classes in three different ways:

import sys
sys.path.append(r"/home/tom/spyder_import")

from testclass_subfolder import testclass_inside
from testclass_folder import testclass_outside
import testclass_folder.testclass_outside as testclass_outside_direct

tc_inside_instance = testclass_inside.tc_inside()
tc_outside_instance = testclass_outside.tc_outside()
tc_outside_direct_instance = testclass_outside_direct.tc_outside()

What is the expected output? What do you see instead?

When running testscript.py in Spyder, I expect to be able to view all three class instances in the object explorer.

What I actually see is the first time I run the script only tc_inside_instance shows properly in the object explorer, the other two classes produce the "Spyder was unable to retrieve the value of this variable from the console." error. If I immediately run the script again tc_outside_instance will sometimes show, but sometimes not. tc_outside_direct_instance will never show properly

Paste Traceback/Error Below (if applicable)

There is no error or traceback in the console

Versions

  • Spyder version: 5.0.3
  • Python version: 3.9.1
  • Qt version: 5.9.7
  • PyQt version: 5.9.2
  • Operating System name/version: Ubuntu 20.10 / Windows 10

Dependencies

Mandatory:

atomicwrites >=1.2.0 : 1.4.0 (OK)
chardet >=2.0.0 : 4.0.0 (OK)
cloudpickle >=0.5.0 : 1.6.0 (OK)
cookiecutter >=1.6.0 : 1.7.2 (OK)
diff_match_patch >=20181111 : 20200713 (OK)
intervaltree >=3.0.2 : 3.1.0 (OK)
IPython >=7.6.0 : 7.22.0 (OK)
jedi =0.17.2 : 0.17.2 (OK)
jsonschema >=3.2.0 : 3.2.0 (OK)
keyring >=17.0.0 : 23.0.1 (OK)
nbconvert >=4.0 : 6.0.7 (OK)
numpydoc >=0.6.0 : 1.1.0 (OK)
parso =0.7.0 : 0.7.0 (OK)
pexpect >=4.4.0 : 4.8.0 (OK)
pickleshare >=0.4 : 0.7.5 (OK)
psutil >=5.3 : 5.8.0 (OK)
pygments >=2.0 : 2.9.0 (OK)
pylint >=1.0 : 2.8.3 (OK)
pyls >=0.36.2;<1.0.0 : 0.36.2 (OK)
pyls_black >=0.4.6 : 0.4.6 (OK)
pyls_spyder >=0.3.2;<0.4.0 : 0.3.2 (OK)
qdarkstyle =3.0.2 : 3.0.2 (OK)
qstylizer >=0.1.10 : 0.1.10 (OK)
qtawesome >=1.0.2 : 1.0.2 (OK)
qtconsole >=5.1.0 : 5.1.0 (OK)
qtpy >=1.5.0 : 1.9.0 (OK)
rtree >=0.9.7 : 0.9.7 (OK)
setuptools >=39.0.0 : 52.0.0.post20210125 (OK)
sphinx >=0.6.6 : 4.0.1 (OK)
spyder_kernels >=2.0.3;<2.1.0 : 2.0.3 (OK)
textdistance >=4.2.0 : 4.2.1 (OK)
three_merge >=0.1.1 : 0.1.1 (OK)
watchdog >=0.10.3;<2.0.0 : 1.0.2 (OK)
xdg >=0.26 : 0.27 (OK)
zmq >=17 : 20.0.0 (OK)

Optional:

cython >=0.21 : None (NOK)
matplotlib >=2.0.0 : None (NOK)
numpy >=1.7 : 1.20.2 (OK)
pandas >=1.1.1 : 1.2.3 (OK)
scipy >=0.17.0 : None (NOK)
sympy >=0.7.3 : None (NOK)

@ccordoba12
Copy link
Member

ccordoba12 commented Jul 12, 2021

Hey @thunderbolt-tom, thanks for reporting. I think the problem is that you're adding your path to import code dynamically, like this

sys.path.append(r"/home/tom/spyder_import")

So, even if that allows you to run your code as expected, the Spyder interface (which runs in a different process) doesn't know about it. Hence, it's unable to find your classes and to display them through the Variable Explorer.

The problem should be solved if you add that path through our PYTHONPATH manager:

imagen

imagen

because that will add that path to the Python process in which Spyder is running. By the way, it'll also add it to your console, so you could avoid doing that sys.path manipulation (which is usually not recommended).

Your other option is to create a Spyder project in the location you're trying to import code.

@thunderbolt-tom
Copy link
Author

Hi @ccordoba12 , thanks. That does make sense, I didn't appreciate that there was a difference between the paths that my code and Spyder were using. or that Spyder needed access to the original class definition to show the variables. Indeed when I add the path to the PYTHONPATH manager and remove the sys.path line it works as expected.

Is it possible for Spyder to detect when this is the cause of it not being able to show the variable so that it can show a more descriptive error message? What threw me off here was the only message was "an error occurred, see the console" but there was nothing displayed in the console.

@ccordoba12
Copy link
Member

Is it possible for Spyder to detect when this is the cause of it not being able to show the variable so that it can show a more descriptive error message?

Could you post a screenshot of what you're seeing to understand what you mean? Thanks!

@thunderbolt-tom
Copy link
Author

Hello,

Yes, see below. I presume "An error occurred, see the console.." is a generic catch-all error message, but in this case it's confusing because there is no output in the console. I have on occasions seen more descriptive messages here when Spyder cannot show the variable, such as when the variable is too big, so if it's possible to detect that the error is caused by Spyder not being able to find the class definition then a message such as "Cannot find class definition file, ensure it is in the Spyder PYTHONPATH" would be useful.

Screenshot from 2021-07-13 03-01-30

@ccordoba12
Copy link
Member

I presume "An error occurred, see the console.." is a generic catch-all error message, but in this case it's confusing because there is no output in the console

I see. We're catching your error with a generic Exception, assuming it will show up in the console.

I have on occasions seen more descriptive messages here when Spyder cannot show the variable

I'll see what I can do about it, but I can't make promises because your error could still be too generic for a more specific message.

@thunderbolt-tom
Copy link
Author

I'll see what I can do about it, but I can't make promises because your error could still be too generic for a more specific message.

Understood. I appreciate your help, thanks for taking the time to look into it.

@adm-resolute
Copy link

Getting the same error. No error appears in the console
I can view the object(dataframe) in the console but not via the variable explorer :(
python 3.85
spyder 5.1.5
mac Catalina 10.15.7

@adm-resolute
Copy link

All good issue was same as above

@giansteve
Copy link

Unfortunately I see the same problem. Does anyone knows if there is a solution already?

@gjain75
Copy link

gjain75 commented Feb 16, 2022

Facing the same problem for quite some time. Any solutions to this please?

image

@jwiemer112
Copy link

I got the same problem, Jesus help us :(

  • Spyder version: 5.1.5 None
  • Python version: 3.8.12 64-bit
  • Qt version: 5.12.9
  • PyQt5 version: 5.12.3
  • Operating System: Windows 10

@guidomeijer
Copy link

I had the same problem but found a work-around. For me the problem was that I has Spyder installed in the base environment of Anaconda but was using a python interpreter from a different environment. When I instead installed and launched Spyder from the same environment as the interpreter I was using, the problem went away.

@jwiemer112
Copy link

jwiemer112 commented Feb 23, 2022

Yeah, I have miniconda installed and spyder in the base environment, in my other environments I installed the spypder-kernels, like it is recommended for environment use. I consider moving to pycharm... each month I face a problem in spyder, the debugger needs hours to start if I wanna debug plotly dash, the variable explorer isnt working correcty, pycharrm doesn't have these problems, however in my heart I'm a spyderino. I'm very sad.

@roteiro
Copy link

roteiro commented Feb 25, 2022

Sounds very similar to my problems in #17065

@jwiemer112
Copy link

I uninstalled spyder kernels from my environment and installed complete new spyder with "conda install spyder". I use miniconda so conda equals conda-forge here. Now the variable explorer works again and I can jump to code lines over the traceback again. I noticed that geopandas got downgraded to 0.9.. maybe that has influence.

Iam still confused that guides recommend my initial behaviour:

https://github.com/spyder-ide/spyder/wiki/Working-with-packages-and-environments-in-Spyder

Install just the spyder-kernels package into the myenv environment, and set your Python interpreter path in Spyder's Preferences to point to myenv's Python executable (see the [final section](https://github.com/spyder-ide/spyder/wiki/Working-with-packages-and-environments-in-Spyder#the-modular-approach). This requires one more initial step, but requires less maintenance in the long run and avoids duplicate Spyder installs.

@lwbaqueros
Copy link

lwbaqueros commented Feb 28, 2022

I have a similar configuration as guido: base environment with Spyder 5.1.5 and other environments with spypder-kernels 2.1.3. All environments with python 3.9.7. Spyder (using the Python interpreter from the working environment) could not retrieve the value of a pandas dataframe.

My working environment had pandas 1.4.1. When I downgraded it to version 1.3.5, the Spyder variable explorer worked again.

@christohog
Copy link

Thanks lwbaqueros, your suggestion of downgardging pandas to 1.3.5 worked for me as well.

I had :
Spyder 5.2.2
spyder-kernels 2.2.1
python 3.8.12
pandas 1.4.1

which was leading me to the following error message :
image

@jwiemer112
Copy link

jwiemer112 commented Mar 9, 2022

I don't even have pandas in my base environment, is that important that you have certain packages in your base environment where spyder is installed?

However I solved the problem by completely installing spyder in my working environment and not only the spyder-kernels.

@noahverner1995
Copy link

noahverner1995 commented Mar 11, 2022

Hi everyone, I just updated pandas to 1.4.0 version today using cmd, and even though Spyder recognizes pandas classes when calling them through the console, as some of you, it doesn't display the information from the dfs stored in the memory anymore as in 1.3.5 version.

image

I open a post here in stackoverflow to request some help from god tier spyder devs to solve this issue, I hope to know if there's a better solution different than downgrading pandas version to 1.3.5 again.

@ghost
Copy link

ghost commented Mar 17, 2022

My working environment had pandas 1.4.1. When I downgraded it to version 1.3.5, the Spyder variable explorer worked again.

Thanks lwbaqueros! This workaround fixed it for me as well on a standalone Spyder install on Windows 10 and a conda environment with python 3.10.2.

@mochsner
Copy link

I uninstalled spyder kernels from my environment and installed complete new spyder with "conda install spyder". I use miniconda so conda equals conda-forge here. Now the variable explorer works again and I can jump to code lines over the traceback again. I noticed that geopandas got downgraded to 0.9.. maybe that has influence.

Iam still confused that guides recommend my initial behaviour:

https://github.com/spyder-ide/spyder/wiki/Working-with-packages-and-environments-in-Spyder

Install just the spyder-kernels package into the myenv environment, and set your Python interpreter path in Spyder's Preferences to point to myenv's Python executable (see the [final section](https://github.com/spyder-ide/spyder/wiki/Working-with-packages-and-environments-in-Spyder#the-modular-approach). This requires one more initial step, but requires less maintenance in the long run and avoids duplicate Spyder installs.

I came to this issue from using Spyder in the same environment as my normal python code. The resolution for an issue with running Spyder within the environment is to run it in a separate environment, like mentioned by @jwiemer112 above in docs, as well as in #17616

Is there no way to use the variable explorer when running spyder from a separate environment? I'm really liking the idea of running spyder from a separate env for stability, but it's missing the entire reason I use Spyder in the first place - the variable explorer.

@ccordoba12
Copy link
Member

@mochsner, the variable explorer should work with external environments in the same way as for the one in which Spyder is installed. Please open a new issue about your problem and provide a step by step description on how to reproduce it.

@mochsner
Copy link

mochsner commented Jun 15, 2022

@mochsner, the variable explorer should work with external environments in the same way as for the one in which Spyder is installed. Please open a new issue about your problem and provide a step by step description on how to reproduce it.

So this prompted me to loop back, and this is limited to DataFrame in my case, which makes sense if pandas may not be installed on the spyder-cf conda env I'm running spyder from.

So, for every variable type I want to view in the spyder variable explorer, I guess I'll just need to install the library the type derives from in spyder-cf env? If this is the case (would love confirmation), I'd be happy to check places in documentation this could be missing, and add a more detailed issue to ensure it's documented across the board.

@ccordoba12
Copy link
Member

So, for every variable type I want to view in the spyder variable explorer, I guess I'll just need to install the library the type derives from in spyder-cf env?

Yes, that's correct.

I'd be happy to check places in documentation this could be missing, and add a more detailed issue to ensure it's documented across the board

Thanks for offering your help @mochsner! Our docs are on this repo:

https://github.com/spyder-ide/spyder-docs

and you can view the Variable Explorer docs here:

http://docs.spyder-ide.org/current/panes/variableexplorer.html

@NIST-Goldstein
Copy link

image

Note: please don't report this issue on Github, there's nothing to do about it.

What is that supposed to mean? Are we SOL??

@Chentir-MT
Copy link

Hello team,
the thread is old but I am still having the same issue:
I have followed all recommendations (installing Spyder directly without going through Anaconda, downgrading pandas...etc) but neither dictionaries nor DataFrames won't open (to be more rigorous: SOME dict and SOME df won't open... with no apparent pattern).

Here is my setting:

Spyder version: 5.3.2 (standalone)
Python version: 3.9.7 64-bit
Qt version: 5.15.2
PyQt5 version: 5.15.7
Pandas version: 1.3.5
Numpy version: 1.23.2
Operating System: Windows 10
Any advice?

@jwiemer112
Copy link

jwiemer112 commented Sep 1, 2022

@Chentir-MT Did you try to create a new anaconda env with conda create -n py39 python=3.10 for example and then installing spyder in it with conda install spyder?

After that I installed pandas with conda install pandas and started spyder with the anaconda prompt from the activated new build environment. I was able to make a new dataframe and visualize that via the variable explorer.

Thats the resulting environment package list (I use conda-forge):
packages in environment at C:\ProgramData\Miniconda3\envs\py310:

Name Version Build Channel alabaster 0.7.12 py_0 conda-forge arrow 1.2.2 pyhd8ed1ab_0 conda-forge astroid 2.12.5 py310h5588dad_0 conda-forge atomicwrites 1.4.1 pyhd8ed1ab_0 conda-forge attrs 22.1.0 pyh71513ae_1 conda-forge autopep8 1.6.0 pyhd8ed1ab_1 conda-forge babel 2.10.3 pyhd8ed1ab_0 conda-forge backcall 0.2.0 pyh9f0ad1d_0 conda-forge backports 1.0 py_2 conda-forge backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge bcrypt 3.2.2 py310he2412df_0 conda-forge beautifulsoup4 4.11.1 pyha770c72_0 conda-forge binaryornot 0.4.4 py_1 conda-forge black 22.6.0 py310h5588dad_2 conda-forge bleach 5.0.1 pyhd8ed1ab_0 conda-forge brotlipy 0.7.0 py310he2412df_1004 conda-forge bzip2 1.0.8 h8ffe710_4 conda-forge ca-certificates 2022.6.15 h5b45459_0 conda-forge certifi 2022.6.15 pyhd8ed1ab_1 conda-forge cffi 1.15.1 py310hcbf9ad4_0 conda-forge chardet 5.0.0 py310h5588dad_0 conda-forge charset-normalizer 2.1.1 pyhd8ed1ab_0 conda-forge click 8.1.3 py310h5588dad_0 conda-forge cloudpickle 2.1.0 pyhd8ed1ab_0 conda-forge colorama 0.4.5 pyhd8ed1ab_0 conda-forge cookiecutter 2.1.1 pyh6c4a22f_0 conda-forge cryptography 37.0.4 py310ha857299_0 conda-forge debugpy 1.6.3 py310h8a704f9_0 conda-forge decorator 5.1.1 pyhd8ed1ab_0 conda-forge defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge diff-match-patch 20200713 pyh9f0ad1d_0 conda-forge dill 0.3.5.1 pyhd8ed1ab_0 conda-forge docutils 0.19 py310h5588dad_0 conda-forge entrypoints 0.4 pyhd8ed1ab_0 conda-forge flake8 4.0.1 pyhd8ed1ab_2 conda-forge gettext 0.19.8.1 ha2e2712_1008 conda-forge glib 2.72.1 h7755175_0 conda-forge glib-tools 2.72.1 h7755175_0 conda-forge gst-plugins-base 1.20.3 he07aa86_0 conda-forge gstreamer 1.20.3 hdff456e_0 conda-forge icu 70.1 h0e60522_0 conda-forge idna 3.3 pyhd8ed1ab_0 conda-forge imagesize 1.4.1 pyhd8ed1ab_0 conda-forge importlib-metadata 4.11.4 py310h5588dad_0 conda-forge importlib_resources 5.9.0 pyhd8ed1ab_0 conda-forge inflection 0.5.1 pyh9f0ad1d_0 conda-forge intel-openmp 2022.1.0 h57928b3_3787 conda-forge intervaltree 3.0.2 py_0 conda-forge ipykernel 6.15.2 pyh025b116_0 conda-forge ipython 7.33.0 py310h5588dad_0 conda-forge ipython_genutils 0.2.0 py_1 conda-forge isort 5.10.1 pyhd8ed1ab_0 conda-forge jedi 0.18.1 pyhd8ed1ab_2 conda-forge jellyfish 0.9.0 py310he2412df_1 conda-forge jinja2 3.1.2 pyhd8ed1ab_1 conda-forge jinja2-time 0.2.0 pyhd8ed1ab_3 conda-forge jpeg 9e h8ffe710_2 conda-forge jsonschema 4.15.0 pyhd8ed1ab_0 conda-forge jupyter_client 7.3.5 pyhd8ed1ab_0 conda-forge jupyter_core 4.11.1 py310h5588dad_0 conda-forge jupyterlab_pygments 0.2.2 pyhd8ed1ab_0 conda-forge keyring 23.8.2 py310h5588dad_0 conda-forge krb5 1.19.3 h1176d77_0 conda-forge lazy-object-proxy 1.7.1 py310he2412df_1 conda-forge libblas 3.9.0 16_win64_mkl conda-forge libcblas 3.9.0 16_win64_mkl conda-forge libclang 14.0.6 default_h77d9078_0 conda-forge libclang13 14.0.6 default_h77d9078_0 conda-forge libffi 3.4.2 h8ffe710_5 conda-forge libglib 2.72.1 h3be07f2_0 conda-forge libiconv 1.16 he774522_0 conda-forge liblapack 3.9.0 16_win64_mkl conda-forge libogg 1.3.4 h8ffe710_1 conda-forge libpng 1.6.37 h1d00b33_4 conda-forge libsodium 1.0.18 h8d14728_1 conda-forge libspatialindex 1.9.3 h39d44d4_4 conda-forge libsqlite 3.39.2 h8ffe710_1 conda-forge libvorbis 1.3.7 h0e60522_0 conda-forge libwebp 1.2.4 h8ffe710_0 conda-forge libwebp-base 1.2.4 h8ffe710_0 conda-forge libxml2 2.9.14 hf5bbc77_4 conda-forge libxslt 1.1.35 h34f844d_0 conda-forge libzlib 1.2.12 h8ffe710_2 conda-forge lxml 4.9.1 py310he2412df_0 conda-forge markupsafe 2.1.1 py310he2412df_1 conda-forge matplotlib-inline 0.1.6 pyhd8ed1ab_0 conda-forge mccabe 0.6.1 py_1 conda-forge mistune 2.0.4 pyhd8ed1ab_0 conda-forge mkl 2022.1.0 h6a75c08_874 conda-forge mypy_extensions 0.4.3 py310h5588dad_5 conda-forge nbclient 0.6.7 pyhd8ed1ab_0 conda-forge nbconvert 7.0.0 pyhd8ed1ab_0 conda-forge nbconvert-core 7.0.0 pyhd8ed1ab_0 conda-forge nbconvert-pandoc 7.0.0 pyhd8ed1ab_0 conda-forge nbformat 5.4.0 pyhd8ed1ab_0 conda-forge nest-asyncio 1.5.5 pyhd8ed1ab_0 conda-forge numpy 1.23.2 py310h8a5b91a_0 conda-forge numpydoc 1.4.0 pyhd8ed1ab_1 conda-forge openssl 1.1.1q h8ffe710_0 conda-forge packaging 21.3 pyhd8ed1ab_0 conda-forge pandas 1.4.4 py310h1c4a608_0 conda-forge pandoc 2.19.2 h57928b3_0 conda-forge pandocfilters 1.5.0 pyhd8ed1ab_0 conda-forge paramiko 2.11.0 pyhd8ed1ab_0 conda-forge parso 0.8.3 pyhd8ed1ab_0 conda-forge pathspec 0.10.0 pyhd8ed1ab_0 conda-forge pcre 8.45 h0e60522_0 conda-forge pexpect 4.8.0 pyh9f0ad1d_2 conda-forge pickleshare 0.7.5 py_1003 conda-forge pip 22.2.2 pyhd8ed1ab_0 conda-forge pkgutil-resolve-name 1.3.10 pyhd8ed1ab_0 conda-forge platformdirs 2.5.2 pyhd8ed1ab_1 conda-forge pluggy 1.0.0 py310h5588dad_3 conda-forge ply 3.11 py_1 conda-forge prompt-toolkit 3.0.30 pyha770c72_0 conda-forge psutil 5.9.1 py310he2412df_0 conda-forge ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge pycodestyle 2.8.0 pyhd8ed1ab_0 conda-forge pycparser 2.21 pyhd8ed1ab_0 conda-forge pydocstyle 6.1.1 pyhd8ed1ab_0 conda-forge pyflakes 2.4.0 pyhd8ed1ab_0 conda-forge pygments 2.13.0 pyhd8ed1ab_0 conda-forge pylint 2.15.0 pyhd8ed1ab_0 conda-forge pyls-spyder 0.4.0 pyhd8ed1ab_0 conda-forge pynacl 1.5.0 py310h4f637d6_1 conda-forge pyopenssl 22.0.0 pyhd8ed1ab_0 conda-forge pyparsing 3.0.9 pyhd8ed1ab_0 conda-forge pyqt 5.15.7 py310hbabf5d4_0 conda-forge pyqt5-sip 12.11.0 py310h8a704f9_0 conda-forge pyqtwebengine 5.15.7 py310hbabf5d4_0 conda-forge pyrsistent 0.18.1 py310he2412df_1 conda-forge pysocks 1.7.1 pyh0701188_6 conda-forge python 3.10.6 h9a09f29_0_cpython conda-forge python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge python-fastjsonschema 2.16.1 pyhd8ed1ab_0 conda-forge python-lsp-black 1.2.1 pyhd8ed1ab_0 conda-forge python-lsp-jsonrpc 1.0.0 pyhd8ed1ab_0 conda-forge python-lsp-server 1.5.0 pyhd8ed1ab_0 conda-forge python-slugify 6.1.2 pyhd8ed1ab_0 conda-forge python_abi 3.10 2_cp310 conda-forge pytoolconfig 1.2.2 pyhd8ed1ab_0 conda-forge pytz 2022.2.1 pyhd8ed1ab_0 conda-forge pywin32 303 py310he2412df_0 conda-forge pywin32-ctypes 0.2.0 py310h5588dad_1005 conda-forge pyyaml 6.0 py310he2412df_4 conda-forge pyzmq 23.2.1 py310h73ada01_0 conda-forge qdarkstyle 3.0.3 pyhd8ed1ab_0 conda-forge qstylizer 0.2.1 pyhd8ed1ab_0 conda-forge qt-main 5.15.4 h467ea89_2 conda-forge qt-webengine 5.15.4 h7325c83_3 conda-forge qtawesome 1.1.1 pyhd8ed1ab_0 conda-forge qtconsole 5.3.2 pyhd8ed1ab_0 conda-forge qtconsole-base 5.3.2 pyha770c72_0 conda-forge qtpy 2.2.0 pyhd8ed1ab_0 conda-forge requests 2.28.1 pyhd8ed1ab_1 conda-forge rope 1.3.0 pyhd8ed1ab_0 conda-forge rtree 1.0.0 py310h1cbd46b_1 conda-forge setuptools 65.3.0 pyhd8ed1ab_1 conda-forge sip 6.6.2 py310h8a704f9_0 conda-forge six 1.16.0 pyh6c4a22f_0 conda-forge snowballstemmer 2.2.0 pyhd8ed1ab_0 conda-forge sortedcontainers 2.4.0 pyhd8ed1ab_0 conda-forge soupsieve 2.3.2.post1 pyhd8ed1ab_0 conda-forge sphinx 5.1.1 pyhd8ed1ab_1 conda-forge sphinxcontrib-applehelp 1.0.2 py_0 conda-forge sphinxcontrib-devhelp 1.0.2 py_0 conda-forge sphinxcontrib-htmlhelp 2.0.0 pyhd8ed1ab_0 conda-forge sphinxcontrib-jsmath 1.0.1 py_0 conda-forge sphinxcontrib-qthelp 1.0.3 py_0 conda-forge sphinxcontrib-serializinghtml 1.1.5 pyhd8ed1ab_2 conda-forge spyder 5.3.3 py310h5588dad_0 conda-forge spyder-kernels 2.3.3 py310h5588dad_0 conda-forge sqlite 3.39.2 h8ffe710_1 conda-forge tbb 2021.5.0 h2d74725_1 conda-forge text-unidecode 1.3 py_0 conda-forge textdistance 4.4.0 pyhd8ed1ab_0 conda-forge three-merge 0.1.1 pyh9f0ad1d_0 conda-forge tinycss2 1.1.1 pyhd8ed1ab_0 conda-forge tk 8.6.12 h8ffe710_0 conda-forge toml 0.10.2 pyhd8ed1ab_0 conda-forge tomli 2.0.1 pyhd8ed1ab_0 conda-forge tomlkit 0.11.4 pyha770c72_0 conda-forge tornado 6.2 py310he2412df_0 conda-forge traitlets 5.3.0 pyhd8ed1ab_0 conda-forge typing 3.10.0.0 pyhd8ed1ab_0 conda-forge typing-extensions 4.3.0 hd8ed1ab_0 conda-forge typing_extensions 4.3.0 pyha770c72_0 conda-forge tzdata 2022c h191b570_0 conda-forge ucrt 10.0.20348.0 h57928b3_0 conda-forge ujson 5.4.0 py310h8a704f9_0 conda-forge unidecode 1.3.4 pyhd8ed1ab_0 conda-forge urllib3 1.26.11 pyhd8ed1ab_0 conda-forge vc 14.2 hb210afc_7 conda-forge vs2015_runtime 14.29.30139 h890b9b1_7 conda-forge watchdog 2.1.9 py310h5588dad_0 conda-forge wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge webencodings 0.5.1 py_1 conda-forge whatthepatch 1.0.2 pyhd8ed1ab_0 conda-forge wheel 0.37.1 pyhd8ed1ab_0 conda-forge win_inet_pton 1.1.0 py310h5588dad_4 conda-forge wrapt 1.14.1 py310he2412df_0 conda-forge xz 5.2.6 h8d14728_0 conda-forge yaml 0.2.5 h8ffe710_2 conda-forge yapf 0.32.0 pyhd8ed1ab_0 conda-forge zeromq 4.3.4 h0e60522_1 conda-forge zipp 3.8.1 pyhd8ed1ab_0 conda-forge zstd 1.5.2 h7755175_4 conda-forge

Note: you may need to restart the kernel to use updated packages.

@ccordoba12
Copy link
Member

@Chentir-MT, you need to install Pandas 1.4 in your external environment because our standalone version comes 1.4 as well. The problem is Pandas 1.3 and 1.4 are incompatible for the operations we need to display Dataframes.

@Chentir-MT
Copy link

Chentir-MT commented Sep 2, 2022

Hello team,
Thank you so much for the replies.
@jwiemer112: I started having these issues through Anaconda... and on a thread it was suggested to migrate to a stand alone... TBH, I am not sure I will go back to Anaconda... I love it, but it is taking too much space on my machine.

@ccordoba12 I checked, and you were right, my custom environment had 1.3 while spyder had 1.4.3
so, I uninstalled it, and:

  • installed 1.4--> didn't work
  • installed 1.4.3--> didn't work
  • This morning spyder invited me to install its newest version (5.3.3), I did... checked native env pandas = 1.4.3 (same is my custom env) ... but still the same problem

So far, I am pulling the data from my unreadable dictionary one entry at a time... but... you know, we code because we are lazy right?

Any help/idea will be more than welcome.

Thanks

PS:
Spyder native python = 3.8.10
Custom version = 3.9.7

I put this here just in case

@emmanuel-contreras
Copy link

Ran into this issue the other day on Ubuntu 22.04, on the base env I uninstalled anaconda spyder and installed the pip version 5.4.0 then installed pandas 1.5.2 because I noticed pandas was not installed on base. Then on a second environment I use as the interpreter I installed pandas 1.5.2 and that seems to work now displaying the dataframes.

@ccordoba12 ccordoba12 added this to the important milestone Dec 1, 2022
@TeoCavi
Copy link

TeoCavi commented Dec 5, 2022

Hello team,
I was encountering this problem using Python 3.10 virtual environment in Win10. I solved activating the virtual environment and installing spyder-kernels 2.4.0 and spyder 5.4.0 inside the venv , Starting spyder from the venv console with these configurations solved the problem.

@river7816
Copy link

I encounter this problem too. I have changed a lots of versions of Spyder. In the end, I found this work for me.

  1. run your file in base env
  2. go back to your own create env, and run the file
    It worked for me !!!!!!!

@stinte16
Copy link

I encounter this problem too. I have changed a lots of versions of Spyder. In the end, I found this work for me.

  1. run your file in base env
  2. go back to your own create env, and run the file
    It worked for me !!!!!!!

i signed for you, thank you bro

@ccordoba12 ccordoba12 modified the milestones: important, v6.0alpha3 Jun 26, 2023
@erbsl
Copy link

erbsl commented Aug 22, 2023

Just encountered a similar problem (spyder: 5.4.3, spyder-kernels: 2.4.4, python: 3.11.4) with same error message: For me, it occurred when I was trying to inspect an instance of a class that I defined in a separate file and imported via * (the code executes fine). If I define the class in the same file, the object is inspectable (yet, this is not an option, as I will have to use this custom class in various contexts). My current "work-around" for me is to import the class via alias (not via *) and then run the code 2x consecutively - in case this helps anyone with a similar problem.
Happy for any other advice and looking forward to the fix!

@Hagbeard
Copy link

Having the same problem with custom class variable inspection. Spyder: 6.0.2, Spyder-kernels: 3.0.1, python: 3.12.7, numpy 2.1.3, pandas: 2.2.3. I installed Spyder, pandas, and numpy in the base environment and that didn't fix anything, tried uninstalling and reinstalling Spyder and no joy.

The only environment I have Spyder working correctly in is Spyder: 4.2.1, Spyder-kernels: 1.10.2, python: 3.8.5, numpy: 1.19.2, pandas: 1.1.3. I never got any version of Spyder 5 to resolve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests