Code change not being recognized when re-running/debugging
See original GitHub issueApplies 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
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:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
That value actually goes here now:
Or you can run code to reload the module: https://stackoverflow.com/questions/437589/how-do-i-unload-reload-a-python-module/437591#437591
Ah I see. got it. Thank you so much for your help!