vscode-jupyter
vscode-jupyter copied to clipboard
Run Selection/Line in Python Terminal doesn't take into account code changes in the import files
Environment data
- VS Code version: 1.86.2
- Jupyter Extension version (available under the Extensions sidebar): XXX
- Python Extension version (available under the Extensions sidebar): v2024.0.1
- OS (Windows | Mac | Linux distro) and version: Windows 11
- Python and/or Anaconda version: 3.11.4
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
- Jupyter server running: Local | Remote | N/A
Expected behaviour
I am doing Run Selection/Line in Python Terminal with shift+Enter in my code I am doing an import from file A with class B I make some code changes in class B then I do run Selection/Line in Python Terminal with shift+Enter to re-import the class with the changes the code changes in file A , class B should be taken into account
I have to exit() the python terminal and start it again for the changes to be taken into account
I have the File A and File B open at the same time. File B is open as a floating window
Actual behaviour
I am doing Run Selection/Line in Python Terminal with shift+Enter in my code I am doing an import from file A with class B I make some code changes in class B then I do run Selection/Line in Python Terminal with shift+Enter to re-import the class with the changes the code changes in file A , class B are not taken into account I have to exit() the terminal and start it again
Steps to reproduce:
create 2 files, File A and File B in File A create a class B def print_some_value(): print ("123") in File B from A import B b=B() b.print_some_value() execute these 3 lines of code with Run Selection/Line in Python Terminal, shift+Enter
then make a change in File A: class B def print_some_value(): print ("456") in File B execute the same 3 lines of code as before with Run Selection/Line in Python Terminal, shift+Enter and even though the class was re-imported the old value is still being printed, should print "456"
I have the File A and File B open at the same time. File B is open as a floating window
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
- XXX
Logs
Output for Jupyter
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Jupyter
)
XXX