Variable explorer does not show variables, if Python interpreter from virtual environment
See original GitHub issueProblem Description
The variable explorer does not show variables anymore if I use a virtual environment in Spyder. The variable explorer works fine (shows all variables) if I run the standard conda environment.
Problem more generally: I don’t know the best way to link a virtualenv or conda env to spyder in 2020.
What steps reproduce the problem?
- Create virtual environment as explained here: https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/
- Link the Python interpreter in Spyder as explained here (" The modular approach"): https://github.com/spyder-ide/spyder/wiki/Working-with-packages-and-environments-in-Spyder#the-modular-approach
- Launch Spyder via Anaconda. When the Python interpreter is linked to the virtual environment, variables don’t how up in the variable viewer anymore. When the interpreter set back to “Default (i.e. the same as Spyder’s)” and the kernel is restarted then the variables show up again.
I first tried this with virtualenv. Then I tried resetting Spyder and tried it with a conda env and different versions of conda install spyder-kernels=0.* or conda install spyder-kernels=1.* ; which lead to different problems. (I have the impression that “The modular approach” is outdated and doesn’t work anymore.
=> I suppose that general question is: what is the best way to link a conda env / virtualenv to spyder in 2020?
What is the expected output? What do you see instead?
Variables should show in the variable viewer, but don’t. It’s just empty, whatever variable I create. (Or more generally: Link a conda env to spyder)
Versions
- Spyder version: 4.1.2
- Python version: 3.7.3
- Operating System name/version: macOS Catalania 10.15.3
Dependencies
# Mandatory:
applaunchservices >=0.1.7 : 0.2.1 (OK)
atomicwrites >=1.2.0 : 1.3.0 (OK)
chardet >=2.0.0 : 3.0.4 (OK)
cloudpickle >=0.5.0 : 1.3.0 (OK)
diff_match_patch >=20181111 : 20181111 (OK)
intervaltree : None (OK)
IPython >=4.0 : 7.13.0 (OK)
jedi =0.15.2 : 0.15.2 (OK)
nbconvert >=4.0 : 5.6.1 (OK)
numpydoc >=0.6.0 : 0.9.2 (OK)
parso =0.5.2 : 0.5.2 (OK)
pexpect >=4.4.0 : 4.8.0 (OK)
pickleshare >=0.4 : 0.7.5 (OK)
psutil >=5.3 : 5.7.0 (OK)
pygments >=2.0 : 2.6.1 (OK)
pylint >=0.25 : 2.4.4 (OK)
pyls >=0.31.9;<0.32.0 : 0.31.9 (OK)
qdarkstyle >=2.8 : 2.8 (OK)
qtawesome >=0.5.7 : 0.7.0 (OK)
qtconsole >=4.6.0 : 4.7.2 (OK)
qtpy >=1.5.0 : 1.9.0 (OK)
rtree >=0.8.3 : 0.9.3 (OK)
sphinx >=0.6.6 : 2.4.4 (OK)
spyder_kernels >=1.9.0;<1.10.0 : 1.9.0 (OK)
watchdog : None (OK)
zmq >=17 : 18.1.1 (OK)
# Optional:
cython >=0.21 : 0.29.15 (OK)
matplotlib >=2.0.0 : 3.1.3 (OK)
numpy >=1.7 : 1.18.1 (OK)
pandas >=0.13.1 : 1.0.3 (OK)
scipy >=0.17.0 : 1.4.1 (OK)
sympy >=0.7.3 : 1.5.1 (OK)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top GitHub Comments
Hey @dalthviz, I should create a new issue for this. I am unable to use the import data button becaues that was my usecase as I was working with spydata files. I have still not checked with python code. I can gather all these observations and raise a detailed issue. Thanks!
I navigated to the project root folder in the spider file explorer. and ran each line of code in my script with F9. (Instead of right-click -> run cell
This is what worked for me.