Variable Explorer is not showing variables in debug mode
See original GitHub issueDescription of your problem
Variable Explorer not working with ipdb.
First off, let me say spyder is amazing, it is so far the only IDE that allow me to debug my code with ease and observe the variable changes, and that worked great for data analysts. Plus it is light weight and fast!
After the upgrade to spyder 3 though, I had a hard time to use this debugging feature.
What steps will reproduce the problem?
- reinstalled anaconda
- ran simple script such as
from itertools import product
def neibours_loc():
locs = [-1, 1, 0]
for x, y in product(locs, repeat=2):
if x!=0 or y!=0:
yield x,y
def count_neighbours(grid, row, col):
s = 0
for x, y in neibours_loc():
try:
if row+x>=0 and col+y>=0:
s+=grid[row+x][col+y]
except:
pass
return s
if __name__ == '__main__':
# These "asserts" using only for self-checking and not necessary for auto-testing
assert count_neighbours(((1, 0, 0, 1, 0),
(0, 1, 0, 0, 0),
(0, 0, 1, 0, 1),
(1, 0, 0, 0, 0),
(0, 0, 1, 0, 0),), 1, 2) == 3, "1st example"
assert count_neighbours(((1, 0, 0, 1, 0),
(0, 1, 0, 0, 0),
(0, 0, 1, 0, 1),
(1, 0, 0, 0, 0),
(0, 0, 1, 0, 0),), 0, 0) == 1, "2nd example"
assert count_neighbours(((1, 1, 1),
(1, 1, 1),
(1, 1, 1),), 0, 2) == 3, "Dense corner"
assert count_neighbours(((0, 0, 0),
(0, 1, 0),
(0, 0, 0),), 1, 1) == 0, "Single"
- debug the script, and check the variables when ipdb start up
What is the expected output? What do you see instead? I expected to observe the variables in the explorer, but none showed up
Please provide any additional information below Please let me know how I can provide more debugging info.
I further tested other use cases and found variable explorer (VE) is working fine with other scopes.
If I put code in cells and execute them one by one, I can see the values in the VE; also if I directly put variables in ipython console, it is working fine.
I think the problem may be with the linkage between ipdb and VE.
Versions and main components
- Spyder Version:3.0.0
- Python Version:3.5.2 64bits
- Operating system:Ubuntu 16.04
Dependencies
Please go to the menu entry Help > Optional Dependencies
(or
Help > Dependencies
), press the button Copy to clipboard
and paste the contents below:
jedi >=0.8.1 : 0.9.0 (OK)
matplotlib >=1.0 : 1.5.3 (OK)
nbconvert >=4.0 : 4.2.0 (OK)
numpy >=1.7 : 1.11.1 (OK)
pandas >=0.13.1 : 0.18.1 (OK)
pep8 >=0.6 : 1.7.0 (OK)
psutil >=0.3 : 4.3.1 (OK)
pyflakes >=0.6.0 : 1.3.0 (OK)
pygments >=2.0 : 2.1.3 (OK)
pylint >=0.25 : 1.5.4 (OK)
qtconsole >=4.2.0: 4.2.1 (OK)
rope >=0.9.4 : 0.9.4-1 (OK)
sphinx >=0.6.6 : 1.4.6 (OK)
sympy >=0.7.3 : 1.0 (OK)
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (4 by maintainers)
Top GitHub Comments
@tdalis, please open a new issue about it. Don’t forget to add a simple piece of code that reproduces your problem and a screenshot of what you’re seeing in our Variable Explorer.
I have a similar problem, I try to see the arrays in the form of a table when I double click on the Name of the Variable in Variable explorer but I get numpy.ndarray instead of numpy.array - Do I do something wrong in my settings? Do I need to reinstall both Anaconda and Spyder? I am using Ubuntu 18.04 LTS and Spyder version 3.2.6+dfsg1-2