question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Variable Explorer is not showing variables in debug mode

See original GitHub issue

Description 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?

  1. reinstalled anaconda
  2. 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"
  1. 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:closed
  • Created 7 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ccordoba12commented, Jun 12, 2018

@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.

0reactions
tdaliscommented, Jun 12, 2018

screenshot from 2018-06-12 13-05-13 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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Data in Variable Explorer is not available for debugging in ...
Let's say I have 2 Python files: file1.py and file2.py . The latter needs a set of data generated by file1.py . However,...
Read more >
Hover over variables no longer show the debug value.
I have a problem since 24/11/2021 where in visual studio 2022 and in visual studio 2019 during a debug session the variables are...
Read more >
IDEs & Debugging - milliams.com
In the top left we see the variable explorer which gives us the name and value of all the variables in scope. In...
Read more >
Debugger - Spyder 4
Furthermore, IPython's magic functions are available in debugging mode. ... Spyder's console and variable explorer showing local and global variables when ...
Read more >
7 Ways to Look at the Values of Variables While Debugging in ...
When stopped in the debugger hover the mouse cursor over the variable you want to look at. The DataTip will appear showing you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found