How can I see a variable list when coding Python on JupyterLab?


I am running Python on JupyterLab. I can run my code, but how may I see the value of variables? In RStudio or Matlab (and also Spyder??), we will see a list of variable value. Don’t we have this function built-in on JupyterLab?


1 Like


you can, for example, use the “Variable Inspector” widget. And then just put it in the split view or in another tab.

All the best!


Thank you very much LustigePerson!!
I believe that my variableinspector has been successfully installed, but how may I launch it? After installation, I am able to run a program, but I do not see the variable inspector.

(base) JM-MacBook-Pro:~ john$ node -v
(base) JM-MacBook-Pro:~ john$ npm -v
(base) JM-MacBook-Pro:~ john$ jupyter labextension install @lckr/jupyterlab_variableinspector
Building jupyterlab assets (build:prod:minimize)
(base) JM-MacBook-Pro:~ john$ jupyter labextension list
JupyterLab v1.1.4
Known labextensions:
   app dir: /Users/john/opt/anaconda3/share/jupyter/lab
        @lckr/jupyterlab_variableinspector v0.4.0  enabled  OK
(base) JM-MacBook-Pro:~ john$

Just right-click in your notebook and open it from the context menu. You can then move the new tab to the side or bottom:

Thank you so much, LustigePerson!
I reset everything and clear all variables,

%reset -f

and truly I retrieve the value of any variable from the notebook,
but the Variable Inspector still contain everything. I expect that all variable should be removed from the variable inspector. Why? Is there any way to delete all the variables so that the variable inspector contains only currently active variables?

Apparently, at least for the %reset somebody filed that as an issue.