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

Debugging: Variable explorer not working #611

Closed
spyder-bot opened this issue Feb 17, 2015 · 33 comments
Closed

Debugging: Variable explorer not working #611

spyder-bot opened this issue Feb 17, 2015 · 33 comments

Comments

@spyder-bot
Copy link
Collaborator

From [email protected] on 2011-04-04T11:57:34Z

Current variables are not showing up in the variable explorer. I can add them to variable explorer and then verify they were created using pdb in the console window. Am I doing something wrong?

What steps will reproduce the problem?

  1. Set a break point in a file
  2. Start debugging and run to the break point line

What is the expected output? What do you see instead? The variable explorer is blank. I expect to see locals in there. What version of the product are you using? On what operating system? Spyder 2.0.9, Windows XP SP3, python 2.6.1

Please provide any additional information below

.

Original issue: http://code.google.com/p/spyderlib/issues/detail?id=611

@spyder-bot
Copy link
Collaborator Author

From pierre.raybaut on 2011-04-04T10:07:10Z

Please provide a test case (simple script with a comment at the breakpoint line) because I remember clearly testing this feature successfully.

@spyder-bot
Copy link
Collaborator Author

From [email protected] on 2011-04-04T10:33:41Z

Things are generally working in my simple test script, but it does not work in my real python code. If you can point me to the correct place in spyderlib, I can take a look into it.

@spyder-bot
Copy link
Collaborator Author

From pierre.raybaut on 2011-04-27T04:57:29Z

This is not the simplest part of Spyder to debug but here are some hints.

The code related to debugging is:

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2011-05-15T19:31:44Z

Labels: Cat-Debugger

@spyder-bot
Copy link
Collaborator Author

From [email protected] on 2012-01-20T15:29:52Z

I saw someone comment on this in the google groups so I thought I'd post an update. Even on this simple script nothing ever shows up in variable explorer:
x = 5
print "testing!"
y = 3

def main():
z = 66
x = "123"

if( name == "main" ):
main()

Currently running 2.1.7 on Win7 64-bit, python 2.7.2
I didn't see anything in the internal console.

@spyder-bot
Copy link
Collaborator Author

From [email protected] on 2012-01-20T15:32:44Z

Also, due to the seeming random nature of this issue it may be hard for us to provide code that will actually duplicate the issue. Maybe you can instrument some code to add some debugging? If you could create a branch I would be able to run the bootstrapped devel version of this branch and see if I could collect some useful info. I never did get around to looking at the files you pasted above to debug this issue myself...

@spyder-bot
Copy link
Collaborator Author

From [email protected] on 2012-05-30T01:21:45Z

I have a similar problem.
Variables created in Command Window are displayed at Variable explorer, but any variables which were created in Editor don't appear at Variable explorer.

Use Python(x,y) 2.7.2.3 (Spyder 2.1.9). Manually updated Spyder to 2.1.10, it still doesn't work.
OS - Win XP SP3, Win 7 x32/64

Attachment: Снимок.JPG

@spyder-bot
Copy link
Collaborator Author

From [email protected] on 2012-05-30T07:14:57Z

In relation to comment 6, the variable explorer is designed to show only those references which exist in the currently active Python console. Definitions in the editor represent references you intent to create in a future session, but they don't really exist yet until you actually run the script itself.

@spyder-bot
Copy link
Collaborator Author

From [email protected] on 2012-05-30T16:03:29Z

@-Steve: Would you mind checking this behavior with the latest version, say 2.1.10? I'm not able to reproduce this problem with 2.1.10 on Windows 7 nor Ubuntu 11.10.

@spyder-bot
Copy link
Collaborator Author

From [email protected] on 2012-05-30T17:08:54Z

In the course of 7 comments: Script was run, but no items were added at variable explorer.
This behavior of the variable explorer is right?

@spyder-bot
Copy link
Collaborator Author

From [email protected] on 2012-05-30T18:35:58Z

@-Sergik11: I apologize for misunderstanding your post in comment 7.

As I mentioned in comment 9, I'm having a hard time reproducing this behavior. I did notice one additional thing about your original screenshot. In the Console tab, notice that there are two tabs, one called Python 1 and the other called untitled0.py. The untitled0.py console looks like it would be the interpreter associated with the file in the editor, and it appears to have completed it's execution. The Variable Explorer will only show variables that are available in only the console that currently has focus. Furthermore, it does not show variables for consoles after they have finished execution.

I have attached two possible run configuration settings that could be applied to a script before running. This config dialog is accessed by hitting F6 with your script while it's active in the editor. If you want to interact with the variables in your script after running it, you have a couple of options. You can set your script to run in its own interpreter and set the option to interact with it after execution. Or you can configure it to run inside the current interpreter, and all the definitions in your script will be dumped into the interpreter workspace so you can then work with them.

Please give this a try and see if it produces the desired result.

Attachment: Dedicated_interpreter_with_interaction.png Current_interpreter.png

@spyder-bot
Copy link
Collaborator Author

From [email protected] on 2012-06-15T08:56:32Z

I believe Variable Explorer is working now, although I've been using your branch that has the improved debugging support. My only "issue" I just posted about here: https://groups.google.com/forum/?fromgroups#!topic/spyderlib/EF3bYYzSO2g

@spyder-bot
Copy link
Collaborator Author

From [email protected] on 2012-07-09T16:26:00Z

Jed,

Would it be possible to get a copy of your fix for this to try? I've just gotten spyder working this afternoon, and I really need the local variable stuff. In fact, several of us in the office could use it.

Bob

@spyder-bot
Copy link
Collaborator Author

From [email protected] on 2012-07-10T07:25:47Z

The variable explorer should be working correctly in version 2.1.10, so there shouldn't be anything special to do for local variables to be working right.

The additional debugging changes mentioned in comment 12 are more related to issue #554 . If you want to experiment with those you can pull down a copy of a clone with all those changes merged together. Instructions are here: https://code.google.com/r/jedludlow-spyderlib-default-merged/source/checkout

@spyder-bot
Copy link
Collaborator Author

From [email protected] on 2012-10-05T04:13:02Z

Don't know if my bug is the same, but you can clearly see it in my attached screenshot..

*I use IPython 0.13

Attachment: spyder variable explore bug.png

@spyder-bot
Copy link
Collaborator Author

From [email protected] on 2012-10-05T04:17:28Z

My bad... found the bug (it was me)... Had to turn off the exclude unsupported types.

Attachment: Spyder var explore fixed.png

@spyder-bot
Copy link
Collaborator Author

From [email protected] on 2012-11-06T14:03:18Z

Variable Explorer is still not really working. Sometimes a few items from the local namespace will appear in the variable editor, but many times it is completely blank or missing various items while debugging.

@spyder-bot
Copy link
Collaborator Author

From [email protected] on 2012-11-06T14:04:32Z

P.S. I'm currently running 44e5ce35cf4d from one of Jed's branches.

@spyder-bot
Copy link
Collaborator Author

From [email protected] on 2012-11-06T14:08:37Z

@-steve.f.thompson: Do you have an short piece of example code that will reproduce the problem?

As an aside, here is a direct link the revision mentioned in comment 18: https://code.google.com/r/jedludlow-spyderlib-default-merged/source/detail?r=44e5ce35cf4dfdf99a63de7f5e9a8ab8e2ef0361

@spyder-bot
Copy link
Collaborator Author

From [email protected] on 2012-11-06T14:16:07Z

No, unfortunately all the trivial examples I've created to attempt to duplicate the issue always work as expected. It's only in real world scenarios where I'm debugging my entire within my entire code base that the problem occurs.

@spyder-bot
Copy link
Collaborator Author

From [email protected] on 2012-11-21T10:16:49Z

Variable explorer is not working for me either. So far I've tried it on Linux Mint 13 (both KDE on my desktop and Cinammon on my laptop). I'm trying simple scripts, setting breakpoints, and hoping to see the local variables as I step through. Perhaps I'm doing something wrong. I can still get the variables from pdb.

On my Windows XP computer at work, which has restricted administrative privileges, I can't get Spyder to run at all. Tried using pip but I can't seem to get the dependencies to install (might be admin related) and also tried the standalone .exe's but they don't work (tried using the reset option also).

@spyder-bot
Copy link
Collaborator Author

From [email protected] on 2013-05-02T16:58:16Z

I found this because I was looking for a way to make the variable explorer work. I've tried quite a few different configuration options, but none of them worked. I've had it working before, and didn't change anything as far as my system setup goes..

..on a whim, I decided to create a project for my single python file, and -- voilà!

..I doubt that this is the issue for everyone, but it's a worthwhile thing to check, and it solved my particular problem.

@spyder-bot
Copy link
Collaborator Author

From contrebasse on 2013-10-08T07:07:56Z

I have a similar problem here: after some random actions the variable explorer is blank, and I have to switch to the console tab to get it displaying the values. A reproducible case is when undocking the variable explorer.

Here's my config:
Spyder Version: 2.3.0dev
Python Version: 2.7.4
Qt Version : 4.8.4, PyQt4 (API v2) 4.10 on Linux
pyflakes >=0.5.0: 0.6.1 (OK)
pep8 >=0.6 : 1.4.6 (OK)
IPython >=0.13 : 0.13.2 (OK)
rope >=0.9.2 : 0.9.2 (OK)
sphinx >=0.6.6 : 1.1.3 (OK)
matplotlib >=1.0: 1.2.1 (OK)
sympy >=0.7.0 : 0.7.2 (OK)
pylint >=0.25 : 0.26.0 (OK)

@spyder-bot
Copy link
Collaborator Author

From [email protected] on 2013-11-13T01:15:55Z

I was thrilled to see that buttons were added for controlling the debugger. Unfortunately, the Variable Explorer remains blank when debugging.

I tried the different workarounds mentioned in previous posts without success.

I'm running Windows XP (used the spyder_2.2.5.win32.exe installer) and Python26.

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-11-13T05:27:22Z

This seems to be a very subtle and difficult problem to solve. Jed described it here a related problem here: https://code.google.com/p/spyderlib/issues/detail?id=991#c7

Labels: MS-v2.4

@spyder-bot
Copy link
Collaborator Author

From [email protected] on 2013-12-18T04:13:36Z

Hello to all!!

I had the same problem.
Untill now, the best solution I could give is delete the python.exe process, and after that, reset your python editor (Spyder in my case).
I am using Spyder 2.2.0 with Python 2.7.5 for 64bit.

I hope it will help you.
Good luck!!

@spyder-bot
Copy link
Collaborator Author

From foobarbecue on 2014-08-25T08:18:11Z

I also can't get locals from scripts to show up in the variable explorer. Spyder 2.3.0, Kubuntu 13.10 .

@spyder-bot
Copy link
Collaborator Author

From foobarbecue on 2014-08-25T08:20:44Z

(Python 2.7.5, IPython 1.1.0)

@spyder-bot
Copy link
Collaborator Author

From [email protected] on 2015-01-21T05:39:44Z

Hi, the variable editor has issues for me whenever a DataFrame is larger 3 columns.
It works beautifully in the IPython console until i double click on one of the larger data frames. Then this error:

Traceback (most recent call last):
File "C:\Users\nathan.n.williams\AppData\Local\Continuum\Anaconda\lib\site-packages\spyderlib\widgets\dicteditor.py", line 411, in createEditor
if not editor.setup_and_check(value):
File "C:\Users\nathan.n.williams\AppData\Local\Continuum\Anaconda\lib\site-packages\spyderlib\widgets\dataframeeditor.py", line 409, in setup_and_check
self.dataModel = DataFrameModel(data, parent=self)
File "C:\Users\nathan.n.williams\AppData\Local\Continuum\Anaconda\lib\site-packages\spyderlib\widgets\dataframeeditor.py", line 75, in init
self.max_min_col_update()
File "C:\Users\nathan.n.williams\AppData\Local\Continuum\Anaconda\lib\site-packages\spyderlib\widgets\dataframeeditor.py", line 90, in max_min_col_update
df_abs = self.df[self.complex_intran].abs()
File "C:\Users\nathan.n.williams\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\core\generic.py", line 3687, in abs
return np.abs(self)
TypeError: bad operand type for abs(): 'NaTType'
Traceback (most recent call last):
File "C:\Users\nathan.n.williams\AppData\Local\Continuum\Anaconda\lib\site-packages\spyderlib\widgets\dicteditor.py", line 411, in createEditor
if not editor.setup_and_check(value):
File "C:\Users\nathan.n.williams\AppData\Local\Continuum\Anaconda\lib\site-packages\spyderlib\widgets\dataframeeditor.py", line 409, in setup_and_check
self.dataModel = DataFrameModel(data, parent=self)
File "C:\Users\nathan.n.williams\AppData\Local\Continuum\Anaconda\lib\site-packages\spyderlib\widgets\dataframeeditor.py", line 75, in init
self.max_min_col_update()
File "C:\Users\nathan.n.williams\AppData\Local\Continuum\Anaconda\lib\site-packages\spyderlib\widgets\dataframeeditor.py", line 90, in max_min_col_update
df_abs = self.df[self.complex_intran].abs()
File "C:\Users\nathan.n.williams\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\core\generic.py", line 3687, in abs
return np.abs(self)
TypeError: bad operand type for abs(): 'NaTType'
Traceback (most recent call last):
File "C:\Users\nathan.n.williams\AppData\Local\Continuum\Anaconda\lib\site-packages\spyderlib\widgets\dicteditor.py", line 411, in createEditor
if not editor.setup_and_check(value):
File "C:\Users\nathan.n.williams\AppData\Local\Continuum\Anaconda\lib\site-packages\spyderlib\widgets\dataframeeditor.py", line 409, in setup_and_check
self.dataModel = DataFrameModel(data, parent=self)
File "C:\Users\nathan.n.williams\AppData\Local\Continuum\Anaconda\lib\site-packages\spyderlib\widgets\dataframeeditor.py", line 75, in init
self.max_min_col_update()
File "C:\Users\nathan.n.williams\AppData\Local\Continuum\Anaconda\lib\site-packages\spyderlib\widgets\dataframeeditor.py", line 90, in max_min_col_update
df_abs = self.df[self.complex_intran].abs()
File "C:\Users\nathan.n.williams\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\core\generic.py", line 3687, in abs
return np.abs(self)
TypeError: bad operand type for abs(): 'NaTType'

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2015-01-30T14:07:17Z

@-nwilliams98: Please open a new issue for this error, and upload there an example we can use to test and solve this problem.

@ccordoba12 ccordoba12 modified the milestones: v4.0, v3.0 Jul 13, 2015
@cervantes-loves-ai
Copy link

just go tools>preferences>variable explorer and remove all the mark and than apply....

@bcolsen
Copy link
Member

bcolsen commented Jun 30, 2017

@ccordoba12 This is fixed in 3.x

@ccordoba12 ccordoba12 removed this from the v4.0beta1 milestone Jun 30, 2017
@ccordoba12
Copy link
Member

Thanks, this is a duplicate of issue #3711, fixed in PR #4202.

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

4 participants