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

Can't seem to get the visualizations to appear #29

Open
hschilling opened this issue Dec 26, 2016 · 11 comments
Open

Can't seem to get the visualizations to appear #29

hschilling opened this issue Dec 26, 2016 · 11 comments
Labels

Comments

@hschilling
Copy link

I can't seem to get any of the visualization show up. I think I am doing as shown in the screencast but it doesn't work. Plus I get this when I try to turn on Memory or Timeline. What am I doing wrong? Thanks.
screen shot 2016-12-26 at 3 38 13 pm

@lgpage
Copy link
Owner

lgpage commented Dec 26, 2016

Hmmm that is strange. Can you post the code snippet here please. What happens if you simply run the code cell with the %%nbtutor magic? Does the visualisation just not pop up?

@lgpage
Copy link
Owner

lgpage commented Dec 26, 2016

Also if you can run the code cell with %%nbtutor --debug and let me know if there is any traceback if will be helpful.

@hschilling
Copy link
Author

hschilling commented Dec 26, 2016

Thanks for the speedy response! Just something simple to try things with:

def fib(n): a,b = 1,1 for i in range(n-1): a,b = b,a+b return a print fib(5)

The visualization just doesn't pop up. So here is my notebook. I just ran the two cells.
image

Nothing popped up

@hschilling
Copy link
Author

hschilling commented Dec 26, 2016

`---------------------------------------------------------------------------
BdbQuit Traceback (most recent call last)
in ()
----> 1 get_ipython().run_cell_magic(u'nbtutor', u'--debug', u'def fib(n):\n a,b = 1,1\n for i in range(n-1):\n a,b = b,a+b\n return a\nprint fib(5)')

/Users/hschilli/anaconda/envs/blue/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in run_cell_magic(self, magic_name, line, cell)
2113 magic_arg_s = self.var_expand(line, stack_depth)
2114 with self.builtin_trap:
-> 2115 result = fn(magic_arg_s, cell)
2116 return result
2117

in nbtutor(self, line, cell)

/Users/hschilli/anaconda/envs/blue/lib/python2.7/site-packages/IPython/core/magic.pyc in (f, *a, **k)
186 # but it's overkill for just that one bit of state.
187 def magic_deco(arg):
--> 188 call = lambda f, *a, **k: f(*a, **k)
189
190 if callable(arg):

/Users/hschilli/anaconda/envs/blue/lib/python2.7/site-packages/nbtutor/ipython/magic.pyc in nbtutor(self, line, cell)
68
69 bdb = Bdb(self.shell, opts)
---> 70 bdb.run_cell(cell)
71
72 self.shell.run_cell(cell)

/Users/hschilli/anaconda/envs/blue/lib/python2.7/site-packages/nbtutor/ipython/debugger.pyc in run_cell(self, cell)
50 self.code_error = True
51 if self.options.debug:
---> 52 raise BdbQuit
53 finally:
54 self.finalize()

BdbQuit:
`

@lgpage
Copy link
Owner

lgpage commented Dec 26, 2016

I'll look into this in the morning for you. For some reason the nbtutor debugger is failing and failing back to ipython to run the cell. It could possible be the 2 space indentation (instead of 4) its not happy with.

Are you able to visualize any of the examples in the repo?

@lgpage lgpage added the bug label Dec 26, 2016
@hschilling
Copy link
Author

Oh! I didn't even think of that. I just tried the first cell from primitives and it works fine. Will try another one with some indenting. BTW, I did try playing with the indenting in my example but it didn't help

@hschilling
Copy link
Author

the functions examples work too!

@lgpage
Copy link
Owner

lgpage commented Dec 26, 2016

Cool, thanks for letting me know. I will try improve this.

@Mr-Ruben
Copy link

Mr-Ruben commented Nov 16, 2018

In my case I was using a python2 kernel. I don't know if it happens with python3 too.

My solution was:
Do not use any print statement in the code. If you do, you get the pop up saying ...

No visualization data was found for this cell. Please include the following magic at the start of the cell and run the code again %%nbtutor

I hope this helps others, as I have been banging my head for some time trying to figure out what was wrong with my installation.

Suggestion/Request: On the documentation, my lack of knowledge does not allow me to understand what is: frames, primitive objects, user namespace. I am sure you can rephrase those lines to make them a bit clearer.

Thanks to the creator of this tool. I think it is quite handy.

With print
image

Without print
image

@samm-github
Copy link

Hi, can someone help with this error "UsageError: Line magic function %%nbtutor not found."
giving below a brief code of what I am doing:

!jupyter nbextension enable nbtutor --py --sys-prefix

%reload_ext nbtutor

%%nbtutor -r -f

%%ipythontutor

a= 1
a

Enabling notebook extension nbtutor/js/nbtutor.min...
- Validating: ok
UsageError: Line magic function %%nbtutor not found.
1

@samm-github
Copy link

using below seems to have worked for me
import sys
!{sys.executable} -m pip install nbtutor # this command seems to have fixed the error

test_1

%lsmagic # shows list of all line magics

test_2
%nbtutor -r -f
UsageError: Line magic function %nbtutor not found (But cell magic %%nbtutor exists, did you mean that instead?)

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

No branches or pull requests

4 participants