Failure Inspecting Variables from Docker Jupyter Notebook: '_VSCODE_InfoImport' is not defined
See original GitHub issueEnvironment data
- VS Code version: 1.15.1
- Extension version (available under the Extensions sidebar): - unsure what you mean; none available
- Jupyter Extension version (available under the Extensions sidebar): v2020.11.372831992
- OS (Windows | Mac | Linux distro) and version: mac 10.15.7 (19H15) (Catalina)
- Python and/or Anaconda version: 3.8.6
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): conda
- Jupyter server running: Local | Remote | N/A - Local in Docker image
Expected behaviour
Run some code in my Jupyter notebook (using pandas, numpy) Click on “Show variables active in Jupyter kernel” button All variables defined in my Jupyter python code appears Click on “Show variable in data viewer” for any of the variables New tab in VS Code opens displaying all the contents of the panda dataframe variable Note: This works if I select “Default - VS Code will automatically start a server for you on localhost”
Actual behaviour
When I run the same notebook against a Docker image based on jupyter/scipy-notebook, I get this behavior:
- Run some code in my Jupyter notebook (using pandas, numpy)
- Click on “Show variables active in Jupyter kernel” button
- Only 5 variables defined in my Jupyter python code appears in the window; the rest of the variables display as “Loading…” message
- Click on “Show variable in data viewer” for any of the variables
- New tab in VS Code opens briefly but then closes, displaying an error message " ‘_VSCODE_InfoImport’ is not defined"
Steps to reproduce:
- Run Docker image based on jupyter/scipy-notebook
- Create new Jupyter notebook in VS Code
- Connect to Docker image
- Paste in this code block:
import pandas as pd
data = [['tom', 10], ['nick', 15], ['juli', 14]]
df = pd.DataFrame(data, columns = ['Name', 'Age'])
df
- Open Output window for Jupyter:
http://127.0.0.1:8888/: Kernel started: 6cc2ad2e-f162-4195-b095-c01b1a587890
http://127.0.0.1:8888/: Creating new notebook
http://127.0.0.1:8888/: Kernel started: 4cf9f902-4c26-45bf-a012-416193e63312
Error 2020-11-23 11:41:18: Failure during variable extraction:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-2-ab305b61bf02> in <module>
----> 1 print(_VSCODE_VariableImport._VSCODE_getVariableInfo(df))
NameError: name '_VSCODE_VariableImport' is not defined
Logs
The logs below use the variable names I created: credentials_df, all_tweets_df.
Output for
Output for Jupyter
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Jupyter
)
Error 2020-11-23 11:03:59: Failure during variable extraction:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-9-9b1fd824018c> in <module>
----> 1 print(_VSCODE_VariableImport._VSCODE_getVariableInfo(credentials_df))
NameError: name '_VSCODE_VariableImport' is not defined
rror 2020-11-23 11:34:41: Failure during variable extraction:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-9-587618beb4a5> in <module>
----> 1 print(_VSCODE_InfoImport._VSCODE_getDataFrameInfo(all_tweets_df))
NameError: name '_VSCODE_InfoImport' is not defined
Error 2020-11-23 11:34:41: [Error: Failure during variable extraction:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-9-587618beb4a5> in <module>
----> 1 print(_VSCODE_InfoImport._VSCODE_getDataFrameInfo(all_tweets_df))
NameError: name '_VSCODE_InfoImport' is not defined
at E.extractJupyterResultText (/Users/jerryharris/.vscode/extensions/ms-toolsai.jupyter-2020.11.372831992/out/client/extension.js:49:575871)
at E.deserializeJupyterResult (/Users/jerryharris/.vscode/extensions/ms-toolsai.jupyter-2020.11.372831992/out/client/extension.js:49:575990)
at E.getDataFrameInfo (/Users/jerryharris/.vscode/extensions/ms-toolsai.jupyter-2020.11.372831992/out/client/extension.js:49:573972)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
at async r.ensureInitialized (/Users/jerryharris/.vscode/extensions/ms-toolsai.jupyter-2020.11.372831992/out/client/extension.js:49:216750)
at async r.getDataFrameInfo (/Users/jerryharris/.vscode/extensions/ms-toolsai.jupyter-2020.11.372831992/out/client/extension.js:49:215836)
at async E.prepDataFrameInfo (/Users/jerryharris/.vscode/extensions/ms-toolsai.jupyter-2020.11.372831992/out/client/extension.js:49:205181)
at async E.showData (/Users/jerryharris/.vscode/extensions/ms-toolsai.jupyter-2020.11.372831992/out/client/extension.js:49:204504)
at async l.create (/Users/jerryharris/.vscode/extensions/ms-toolsai.jupyter-2020.11.372831992/out/client/extension.js:49:214578)
at async f.showDataViewer (/Users/jerryharris/.vscode/extensions/ms-toolsai.jupyter-2020.11.372831992/out/client/extension.js:32:570651)]
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (10 by maintainers)
Top Results From Across the Web
Failure Inspecting Variables from Docker Jupyter Notebook ...
Run some code in my Jupyter notebook (using pandas, numpy); Click on "Show variables active in Jupyter kernel" button; Only 5 variables defined...
Read more >How can I solve the variable is not defined error in jupyter ...
Note: this code work fine in Pycharm environment but it doesn't work on jupyter notebook giving me error variable auth is not defined....
Read more >How to Run Jupyter Notebook on Docker | by Shinichi Okada
The first command above will run the Jupyter minimal-notebook connecting the local directory to a Docker container.
Read more >Troubleshooting Common Problems - Jupyter Docker Stacks
In the case of the docker-stacks images, you can set the CHOWN_EXTRA and CHOWN_EXTRA_OPTS environment variables. For example, to change the ownership of...
Read more >Environment Magic with Jupyter and Docker
Jupyter Notebooks and Docker are great tools for quickly getting ... to solve problems, programming is not only a great career option, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jlharri and @joyceerhl No solution yet, but just wanted to note that I was able to set that docker image up locally and I can repro the issue. So I’m investigating on that now.
Hello, Sorry for the delay. I downloaded the new extension and it works! There is a slight 1-2 second delay when displaying the variables. But all variables are displayed and I can open them up in a separate window. Thanks!!
Jerry [image: image.png]
On Thu, Dec 3, 2020 at 1:31 PM Rich Chiodo notifications@github.com wrote: