Skip to content
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

After I do a change in a .py code or Python virtual environment package that the notebook uses, they are not reflected in the notebook and need to close the VSCode and open it again to have them reflected #8767

Closed
monajalal opened this issue Jan 22, 2022 · 4 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@monajalal
Copy link

monajalal commented Jan 22, 2022

So, whenever I change my ViT.py code or install a new package in my Python Virtual Environment, those changes are not picked up by the Jupyter notebook that I am running inside the VSCode. The only way that I am currently able to get them reflected is to close VSCode and open it again which is quite a lot of overhead given I am using SSH to connect to local machine. Is there a way to make these changes seamless ideally?

Screen Shot 2022-01-21 at 7 00 55 PM
For example, in the image above, you see even after installing the Python package that is requested, it is still not recognized.

Environment data

  • VS Code version: XXX
    Screen Shot 2022-01-21 at 7 05 03 PM

  • Jupyter Extension version (available under the Extensions sidebar): XXX
    Screen Shot 2022-01-21 at 7 05 46 PM

  • Python Extension version (available under the Extensions sidebar): XXX
    Screen Shot 2022-01-21 at 7 06 22 PM

  • OS (Windows | Mac | Linux distro) and version: XXX
    Local:
    Screen Shot 2022-01-21 at 7 06 50 PM
    remote:

$ lsb_release -a
LSB Version:	core-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarch
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.3 LTS
Release:	20.04
Codename:	focal
  • Python and/or Anaconda version: XXX
[19:07:23] (dpcc) jalal@echo:~$ python
Python 3.8.10 (default, Nov 26 2021, 20:14:08)
[GCC 9.3.0] on linux
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): XXX
    Native Python virtual environment on remote machine (name of virt env: dpcc)
  • Jupyter server running: Local | Remote | N/A
    Remote

Expected behaviour

After I closed and opened the VScode (and reconnect to remote host), this is what the expected behavior should be (progress bar for training):

Screen Shot 2022-01-21 at 7 11 50 PM

This is regarding cell #25 here https://github.com/lucidrains/vit-pytorch/blob/main/examples/cats_and_dogs.ipynb

Actual behaviour

XXX

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. XXX

Logs

Output for Jupyter in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Jupyter)

XXX

@monajalal monajalal added the bug Issue identified by VS Code Team member as probable bug label Jan 22, 2022
@rchiodo
Copy link
Contributor

rchiodo commented Jan 22, 2022

This issue here is related: #4555

@rchiodo
Copy link
Contributor

rchiodo commented Jan 22, 2022

But for a module install (and if you're not using auto_reload), you have to restart the kernel. You shouldn't have to restart VS code.

@monajalal
Copy link
Author

Could you please give me a hint how to use auto_reload in jupyter notebook within VSCode? @rchiodo

@rchiodo
Copy link
Contributor

rchiodo commented Jan 22, 2022

The directions here should work (haven't tried it myself in some time)
https://ipython.org/ipython-doc/3/config/extensions/autoreload.html

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

3 participants