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.

Cannot use `Jupyter:` and `Notebook:` commands for interactive window when `.py` file has focus (jupytext mode)

See original GitHub issue

Issue Type: Bug


  1. Open some .py file
  2. Output something into Interactive-1 window
  3. Open command pallete (Ctrl + Shift + P) from .py file
  4. Apply Jupyter: Clear All

Cells in Interactive-1 window are not cleared.

Also I can’t use Notebook: Restart Kernel from .py file. I can’t even find this command.

(These commands work fine if i select Interactive-1 window)


Extension version: 2021.8.1195043623 VS Code version: Code 1.59.0 (379476f0e13988d90fab105c5c19e7abc8b1dea8, 2021-08-04T23:13:20.182Z) OS version: Linux x64 5.8.0-63-generic snap Restricted Mode: No

System Info
Item Value
CPUs AMD Ryzen 5 4600H with Radeon Graphics (12 x 1722)
GPU Status 2d_canvas: unavailable_software
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: disabled_off
rasterization: disabled_software
skia_renderer: enabled_on
video_decode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software
Load (avg) 1, 1, 1
Memory (System) 15.08GB (0.50GB free)
Process Argv –no-sandbox --force-user-env --unity-launch --crash-reporter-id 417bce1b-d3f2-43a2-bf1b-e2eb11a9b3f6
Screen Reader no
VM 0%
DESKTOP_SESSION ubuntu
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP ubuntu
XDG_SESSION_TYPE x11
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspyt653:30270858
pythonvspyt602:30300191
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyt639:30300192
pythontb:30283811
pythonvspyt551cf:30345471
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
pythondataviewer:30285071
pythonvsuse255:30340121
vscod805:30301674
pythonvspyt200:30340761
vscextlang:30333561
binariesv615:30325510
vsccppwt:30329788
pythonvssor306:30344512
bridge0708:30335490
vstre464cf:30346473

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
joyceerhlcommented, Sep 7, 2021

This is fixed in the latest Insiders build and will become available in the upcoming Stable. Kernel restart, interrupt, and interactive clear all can now be invoked when the .py file has focus, via https://github.com/microsoft/vscode-jupyter/commit/8042246baec3828d23abe260065bbb7c35590a17

1reaction
joyceerhlcommented, Sep 1, 2021

Thanks for the feedback–this is happening because these commands require the interactive window to have focus. We can change the enablement clauses for many of these commands to also work when a #%% Python file is active.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Working with Jupyter code cells in the Python Interactive window
View, inspect, and filter variables using the Variables Explorer and Data Viewer; Connect to a remote Jupyter server; Debug a Jupyter notebook; Export...
Read more >
Using at the Command Line - Jupytext documentation
jupytext --to py notebook.ipynb # convert notebook.ipynb to a .py file ... Jupytext has a --sync mode that updates all the paired representations...
Read more >
Trying to code on my own machine - Q's - Python
I have Jupyter notebook because codecademy told me I needed it. However the tutorials with Jupyter only address starting a new notebook so...
Read more >
How do I convert a IPython Notebook into a Python file via ...
On the command line, you can use nbconvert : $ jupyter nbconvert ... Convert jupyter notebook to python script specifying output filename
Read more >
The Jupyter+Git problem is now solved - Hacker News
A benefit if .py files is not always that jupyter is bad, ... There is always a lot of org-mode promotion on here...
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