question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

On upgrading from 7.5 to 7.6.1, autoreload in Jupyter Notebook is much slower, to the point of seeming to hang for a >minute. When I lose my patience and interrupt execution, I get a traceback like this

[autoreload of algos.ppo.nets failed: Traceback (most recent call last):
  File "/opt/conda/lib/python3.7/site-packages/IPython/extensions/autoreload.py", line 245, in check
    superreload(m, reload, self.old_objects)
  File "/opt/conda/lib/python3.7/site-packages/IPython/extensions/autoreload.py", line 450, in superreload
    update_generic(old_obj, new_obj)
  File "/opt/conda/lib/python3.7/site-packages/IPython/extensions/autoreload.py", line 387, in update_generic
    update(a, b)
  File "/opt/conda/lib/python3.7/site-packages/IPython/extensions/autoreload.py", line 357, in update_class
    update_instances(old, new)
  File "/opt/conda/lib/python3.7/site-packages/IPython/extensions/autoreload.py", line 317, in update_instances
    update_instances(old, new, obj, visited)
  File "/opt/conda/lib/python3.7/site-packages/IPython/extensions/autoreload.py", line 317, in update_instances
    update_instances(old, new, obj, visited)
  File "/opt/conda/lib/python3.7/site-packages/IPython/extensions/autoreload.py", line 317, in update_instances
    update_instances(old, new, obj, visited)
  [Previous line repeated 2 more times]
  File "/opt/conda/lib/python3.7/site-packages/IPython/extensions/autoreload.py", line 300, in update_instances
    for obj in (obj for obj in objects if id(obj) not in visited):
KeyboardInterrupt
]

I don’t have a minimal example I’m afraid, but if anyone arrives here Googling for a similar problem, rolling back to 7.5 fixes it.

My specs are

Ubuntu 18.04.2 LTS Python 3.73 Jupyter:

jupyter==1.0.0
jupyter-client==5.3.0
jupyter-console==6.0.0
jupyter-contrib-core==0.3.3
jupyter-contrib-nbextensions==0.5.1
jupyter-core==4.5.0
jupyter-highlight-selected-word==0.2.0
jupyter-latex-envs==1.4.6
jupyter-nbextensions-configurator==0.4.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:9
  • Comments:19 (10 by maintainers)

github_iconTop GitHub Comments

4reactions
smerzbachcommented, Jul 19, 2019

I can’t add further debug info, but I had a similar problem with ipython-7.6.1 and Spyder-3.3.6:

  • open ipython console
  • select some code in the editor
  • hit F9 (this essentially copies the code to the console and executes it)

Every other time, this causes ipython to hang until interrupted by ctr+c, which then gives a stacktrace as pasted above. Repeating the exact same procedure works fine on the next try. Downgrading to ipython-7.5 resolved the issues.

This is all on a Ubuntu 16.04, with Spyder and ipython installed via pip3:

pip3 install --user --upgrade spyder3

To fix the issue:

pip3 install --user ipython==7.5

Is there further info I could provide?

2reactions
bnaulcommented, Aug 5, 2019

This problem seems to be extra bad when I’m working with large pandas DataFrames; is it possible that every single string value is getting scanned by the autoreload logic? If so is there any possible way to work around this case?

Read more comments on GitHub >

github_iconTop Results From Across the Web

tf2 does auto reload slow your firing speed - Reddit
tf2 does auto reload slow your firing speed ... No. If anything, it helps a ton. ... I just wish they'd remove the...
Read more >
Using autoreload to speed up IPython and Jupyter work
I try to do all of my interactive Python development with either Jupyter notebooks or an IPython session. One of the main reasons...
Read more >
Jupyter autoreload workflow - Stack Overflow
I'm trying to understand the best workflow for impotring script files into a jupyter notebook. I have a notebook that does somethig like:...
Read more >
Slow autoreload - Questions and Answers
Is there a way to speed up Strapi when auto reloading? Strapi takes about 4-8 seconds each time I modify a controller.
Read more >
Automatically Reload Modules with %autoreload
%autoreload to the rescue! ... IPython with %autoreload enabled will be slightly slower. IPython is quite smart about what to reload.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found