vscode-jupyter: Failure Inspecting Variables from Docker Jupyter Notebook: '_VSCODE_InfoImport' is not defined

Environment 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:

  1. Run some code in my Jupyter notebook (using pandas, numpy)
  2. Click on “Show variables active in Jupyter kernel” button
  3. Only 5 variables defined in my Jupyter python code appears in the window; the rest of the variables display as “Loading…” message
  4. Click on “Show variable in data viewer” for any of the variables
  5. New tab in VS Code opens briefly but then closes, displaying an error message " ‘_VSCODE_InfoImport’ is not defined"

Steps to reproduce:

  1. Run Docker image based on jupyter/scipy-notebook
  2. Create new Jupyter notebook in VS Code
  3. Connect to Docker image
  4. Paste in this code block:

import pandas as pd 
data = [['tom', 10], ['nick', 15], ['juli', 14]] 
df = pd.DataFrame(data, columns = ['Name', 'Age']) 
df

  1. 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 Jupyter in the Output panel (ViewOutput, 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)]

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (10 by maintainers)

Most upvoted 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.