question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Jupyter interactive cannot use via remote ssh as it showed chunkLoadError

See original GitHub issue

Issue Type: Bug

When I use remote ssh connected to the ubuntu server, I cannot ordinarily open the .ipynb file and cannot open the interactive window when reading the .py file. When I open the .ipynb file, the remote vscode window will reconnect repeatedly. When I open the interactive window on the .py file, the interactive window cannot normally display, with a notion 图片1

I check the Webview developer tools, there are following warnings: 图片2

Extension version: 2020.12.414227025 VS Code version: Code 1.53.0 (8490d3dde47c57ba65ec40dd192d014fd2113496, 2021-02-03T20:36:38.611Z) OS version: Windows_NT x64 10.0.19042 Remote OS version: Linux x64 5.8.0-41-generic

System Info
Item Value
CPUs Intel® Core™ i7-10710U CPU @ 1.10GHz (12 x 1608)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: enabled
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.83GB (7.77GB free)
Process Argv –folder-uri vscode-remote://ssh-remote%2Bfsk-remote/home/bowen/git/coding/python --crash-reporter-id fb7316d2-25cc-4b66-bbff-db82fd1cc005
Screen Reader no
VM 0%
Item Value
Remote SSH: fsk-remote
OS Linux x64 5.8.0-41-generic
CPUs Intel® Xeon® CPU E5-2678 v3 @ 2.50GHz (48 x 3247)
Memory (System) 94.28GB (75.92GB free)
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492cf:30211402
pythonvsdeb440:30248342
pythonvsded773:30248341
pythonvspyt875:30251590

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:31 (10 by maintainers)

github_iconTop GitHub Comments

4reactions
PhilippRuchsercommented, Apr 27, 2021

I have the same problem. I am not using .ipynb files, but simple .py files with code sections (# %%). The .py runs just fine in the remote shell, but shows these strange messages when run in the interactive console.

I have encountered a similar problem in scripts where I do not output anything to sys.stdout.

If I execute the following cell from a .py file via SHIFT+ENTER and then inspect x in the interactive terminal, I receive the aforementioned error.

# %%
import numpy as np

x = np.random.rand(3)
# %%
# [inspect `x` in the interactive terminal] -> error

However, I do not get the error when I have printed something in the script prior to the inspection in the interactive terminal.

# %%
import numpy as np

print("init stdout")
x = np.random.rand(3)
# %%
# [inspect `x` in the interactive terminal] -> no error
1reaction
ricardobnscommented, May 6, 2021

Following on the discoveries of @janjagusch @PhilippRuchser

System setup Running VS Code on WSL2. Extension versions are:

  • Jupyter: 2021.5.745244803
  • Python: 2021.4.765268190

Python interpreter is version 3.8.8 installed in an anaconda environment on WSL2 (‘Python 3.8.8 64-bit (‘base’: conda)’)

Workaround

  1. Create a new .py file in the working directory
  2. Add one line with a print statement (e.g. print(“init stdout”) )
  3. Right-click and select Run Current File in Interactive Window

Once the three steps above are complete, I am able to continue using the interactive window and run cells in other files without errors.

Creating and running the file with the print statement: image

Subsequently running other files in the same working directory: image

Read more comments on GitHub >

github_iconTop Results From Across the Web

REMOTE-SSH development with VS Code in Python
I connect to my Ubuntu machine just fine using the SSH Tunnel and select my python interpreter, but when I try to run...
Read more >
Tutorial: Set up a Jupyter notebook in JupyterLab to test and ...
AWS Glue tutorial that shows how to connect a Jupyter notebook in JupyterLab running on your local machine to a development endpoint.
Read more >
Manage Jupyter notebook servers | PyCharm Documentation
In PyCharm, you can execute code cells using: Managed server – a Jupyter server that is automatically launched by PyCharm for the current ......
Read more >
Remote jupyter notebooks with ssh port forwarding
In this post, I'd like to show how I proceed to create and use jupyter notebooks on a remote machine. You will learn...
Read more >
Remote Python Development in Visual Studio Code
Like the docker scenario, you can use the “Remote-SSH” extension to open a remote workspace over an SSH connection. To get started, first...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found