[Bug] %run magic with jupyter notebook
See original GitHub issue🐛 Bug
Expect to run hydra in a notebook cell and get realtime output like in Terminal.
Two ways of running a python file in Jupyter !python (calling the terminal directly) -> but cannot get real time output %run (Jupyter way of running python file, but does not seems compatible with Hydra directly)
I am expecting this can run %run runner.py exp_name=abc
To reproduce
hydra_tqdm_notebook.py
import hydra
@hydra.main(config_path="configs/config.yaml")
def experiment_runner(cfg) -> None:
from tqdm import tqdm_notebook as tqdm
for i in tqdm(range(5)):
import time
time.sleep(0.02)
print('helloworld')
if __name__ == "__main__":
experiment_runner()
** Stack trace/error message **
Expected Behavior
The only difference between test_hydra_tqdm_notebook.py
and test_tqdm_notebook.py
is I wrapped it inside the Hydra runner. I expect the output to be the same.
System information
- Hydra Version :
- Python version :
- Virtual environment type and version :
- Operating system :
Additional context
test_tqdm_notebook.py
from tqdm import tqdm_notebook as tqdm
for i in tqdm(range(100)):
import time
time.sleep(0.02)
print('helloworld')
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Built-in magic commands — IPython 8.7.0 documentation
Changed in version 7.3: When running code, user variables are no longer expanded, the magic line is always left unmodified. positional arguments: statement...
Read more >Magic Commands - Problem Solving with Python
One of the most popular magic commands is: %matplotlib inline. Entering the %matplotlib inline command at the top of a Jupyter notebook renders...
Read more >iPython/Jupyter %run magic appending .py to filename and ...
I am running this code in two notebooks in the same directory, however, in one of them I get this error: ERROR:root:File `'../Tools/imports....
Read more >Episode 2: How to use Jupyter Notebook's Magic Commands?
Refer this for more - http://ipython.readthedocs.io/en/stab... … Show more ... running jupyter notebooks on a remote cluster. Tyler Matheny.
Read more >Tracking Jupyter Notebooks - Documentation - Weights & Biases
On the overview tab of your run page, you'll see a link to the Colab. 2. Jupyter Magic: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Your example is a bit convoluted. can you try to minimize it a bit? I am not sure I understand the role of each of the 3 files.
I have a fix coming for this issue (%run). If this does not solve the other problem file a different issue and explain how to reproduce. I have never used Jupyter Lab Terminal.