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.

Code change not being recognized when re-running/debugging

See original GitHub issue

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

We have written the needed data into your clipboard because it was too large to send. Issue Type: Bug

I am not sure how to provide the steps to reproduce the problem. I should also mention that I am relatively new to vscode.

I have set up an anaconda environment and downloaded the necessary packages to run my company’s code.

I have set up a test script and function to show a simplified version of the problem.

I am using Jupyter to run cell by cell. when I get rid of the cells and debug in the terminal, the problem disappears.

script: test.py

# %%
from add import add
a=3
b=10
c=add(a,b)
print(c)

function: add.py

import numpy as np
def add(a,b):
    print('Hello world')
    return(a+b)

After running the cell, the output should read Hello world. When I change the string to something else entirely, the change is not recognized and it keeps reading ‘Hello World’

I should clarify that the only way for the changes to be registered is to restart the kernel or reboot vscode. VS Code version: Code 1.65.2 (c722ca6c7eed3d7987c0d5c3df5c45f6b15e77d1, 2022-03-10T14:33:55.248Z) OS version: Windows_NT x64 10.0.19043 Restricted Mode: No

System Info
Item Value
CPUs Intel® Core™ i9-10885H CPU @ 2.40GHz (16 x 2400)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.73GB (14.97GB free)
Process Argv –crash-reporter-id 1f69ff88-bc2c-496d-86da-ee182071c101
Screen Reader no
VM 0%
Extensions (5)
Extension Author (truncated) Version
python ms- 2022.2.1924087327
vscode-pylance ms- 2022.3.1
jupyter ms- 2022.2.1030672458
jupyter-keymap ms- 1.0.0
jupyter-renderers ms- 1.0.6
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyl392:30443607
pythontb:30283811
pythonvspyt551cf:30345471
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscoreces:30445986
pythondataviewer:30285071
vscod805cf:30301675
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30449410
vsclayoutctrt:30451275
dsvsc009:30452663
pythonvspyt640:30450904
vscscmwlcmc:30438804
vscaac:30438847
pynewfile477:30450038

Please paste.

VS Code Version

Version: 1.65.2 (user setup) Commit: c722ca6c7eed3d7987c0d5c3df5c45f6b15e77d1 Date: 2022-03-10T14:33:55.248Z Electron: 13.5.2 Chromium: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Windows_NT x64 10.0.19043

Jupyter Extension Version

v2022.2.1030672458

Jupyter logs

No response

Coding Language and Runtime Version

3.7.7

Language Extension Version (if applicable)

No response

Anaconda Version (if applicable)

v2022.2.1924087327

Running Jupyter locally or remotely?

Local

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rchiodocommented, Mar 16, 2022

That value actually goes here now:

"jupyter.runStartupCommands": ["%load_ext autoreload", "%autoreload 2"]

Or you can run code to reload the module: https://stackoverflow.com/questions/437589/how-do-i-unload-reload-a-python-module/437591#437591

0reactions
moonj94commented, Mar 16, 2022

Ah I see. got it. Thank you so much for your help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Apply Code Changes button not working in Visual Studio 2019
Enable native code debug option not selected. When I run the project using F5, if I make a change to view or controller...
Read more >
Edit and Continue: "Changes are not allowed when..."
Go to Tools > Options > Debugging > General and make sure Require source files to exactly match the original version is unchecked....
Read more >
Managed Edit And Continue changes are not detected by the ...
It seems to me that editing code when the Debugger is in break mode does not seem to always be picked up by...
Read more >
Troubleshooting common PHP debugging issues | PhpStorm ...
Breakpoints are not being hit · Verify the breakpoint is not disabled. · Make sure that path mappings are correct. · On macOS,...
Read more >
Application running in debug mode in the test environment not ...
log file found in the .metadata directory, you might see the following exception being thrown: !MESSAGE Problems occurred when invoking code ...
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