Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IPython console in spyder extremely slow in Anaconda

I'm trying Anaconda/Spyder after using the standard python installation/IDLE for several years. The console (and variable explorer) becomes progressively slower during each work session, with every script and interactive command that I run. Eventually it takes minutes to get a response to simple commands like print, and then it stops responding completely and I shut it down. It's pretty disruptive to my work.

Mac OSX 10.13.6

conda version : 4.5.11
conda-build version : 3.15.1
python version : 3.7.0.final.0

qt 5.9.6
spyder 3.3.1 
ipython 7.1.1

I do use matplotlib frequently. Whenever possible I use plt.ioff() at the beginning of a script and/or plt.close('all') at the end. Turning off matplotlib support completely in preferences doesn't help and it's not a permanent fix anyway. Python is not using anywhere near all my CPU or RAM.

like image 713
andbeonetraveler Avatar asked Nov 19 '18 19:11

andbeonetraveler


People also ask

Why is Spyder running so slow?

Most of the bugs appear in the newest releases, and can cause multiple problems including making Spyder very slow. By updating at a later date, most of the bugs would have been solved by then and it is a much safer approach.

How do I use IPython console on Spyder?

Connecting to a console. Spyder can launch new IPython instances itself, through “Open an IPython console” under the Consoles menu, the IPython Console pane menu or its context menu ( Ctrl - T by default), to take advantage of the full suite of Spyder's features.

How do I disable IPython console on Spyder?

Once you've clicked anywhere in the IPython Console Window (again, the output window), then, once you press ctrl+c, your program will terminate.

How do I fix my python Spyder?

Restart your machine, in case the problem lies with a lingering process or another such issue. From the Anaconda Prompt/Terminal/command line (on Windows/Mac/Linux), run the command spyder --reset , which will restore Spyder's config files to their defaults, which solves a huge variety of Spyder issues.


1 Answers

As far as I've found out, the problem seems to be with the latest major release of the ipython kernel. Pinning the version of ipykernel to 4.10.0 solved it for me. To do so, add a line containing ipykernel 4.* to the file ~/anaconda3/conda-meta/pinned. Create the file if it does not exist yet. Then conda update ipykernel which will actually downgrade to 4.10.0. Worked for me!

like image 143
Sjoerd Avatar answered Sep 20 '22 19:09

Sjoerd