-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In new native interactive window, restarting the kernel does not clear imported modules #7041
Comments
@filipporemonato Thanks for the detailed repro steps here. I do repro both the issue with the variables not showing up until code is run in the IW as well as the issue with variables not being cleared on a restart. However I did see the new line that I added being printed when added to run_test.py ('Extra line added is what I added). Are you sure that you are not seeing the line added from the file change? |
Hei @IanMatthewHuff thanks for checking this out. Good you could repro the variables showing/clearing. I'm unsure why you could not repro the module reload; this is what I see: As you can see the output does not change after restarting the kernel. And this is after the restart: I also made sure the modified file was saved before running the import again, and also tried again by saving it before restarting the kernel. |
@filipporemonato Do you happen to have |
Hei @joyceerhl , no I don't have It's worth mentioning that opting out of the new native interactive window thourgh the last line in the settings posted above solves the issue, i.e. the modules get reloaded correctly. |
I am facing the same issue with restart kernel. Does not update the imported modules. |
Hi @joyceerhl, some days ago there has been a small update of VS Code; now I have version 1.59.1 (was 1.59.0). |
Sounds like this issue has been fixed--please file a new issue if this is not working for you. |
Environment data
Expected behaviour
Restarting the kernel should clear all variables and imports
Actual behaviour
After restarting the kernel, the variables remain in displayed in the "variables" tab of jupyter. Querying them from the interactive window's command line results in the correct "name XX not defined".
However, imported modules are not reloaded
Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
test.py
:test_fun.py
:test.py
, notice the output is as expected. In passing, note that the variables are NOT present in the "variables" tab, but they appear if, having the tab open, some code is run through the Interactive Window command line.my_fun
, for instance add another line likeprint('now I am printing an extra line')
.test.py
, notice the new line is not being printed, which means the imported module is not reloaded.Logs
Output for
Jupyter
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toJupyter
)The text was updated successfully, but these errors were encountered: