Luca
Luca

Reputation: 169

iPython console in Spyder does not enter in debug

I removed and started with a fresh new installation of Anaconda. Just after installation I created a custom environment (cust_env) Both the cust_env and the base environment have Python 3.9. I then installed on both environments Spyder 5.1.

Now, the problem is the following:

If I run Spyder from the base environment, it seems to work and debug my code normally, while if I run it from the cust_env, when I enter in debug mode the console apparently does not answer anymore (the debug prompt does not appear and you must restart the kernel to have it back again).

I also tryed with different versions of Python (3.7.x and 3.8.x) and of Spyder (4.x, 3.x) and the behaviour looks identical.

I cannot understand what might be the difference which does not allow to use Spyder in an environment different to the base one.

Upvotes: 4

Views: 1900

Answers (1)

Luca
Luca

Reputation: 169

I was able to delimit the problem and find a workaround.

The base problem is that, when you create a new environment of Anaconda, since it contains very few packages (Python and few more), when you afterwards install a new package, it is fully updated with all its dependancies. In particular

conda install spyder

installs Spyder and all its dependancies at the very last available version.

On the opposite side, the base environment of Anaconda already contains plenty of packages and conda does it best to install the most updated version which is still compatible with the existing packages, but very often it is not the last one. Now, it appears that Spyder uses QT to show the graphical interface and one of its dependancies qtconsole=5.2.2 has some bug which causes the problem. When installing Spyder from the base environment, conda installs qtconsole=5.1.1 and the problem does not appear while, if installing from a fresh new environment, qtconsole=5.2.2 is installed and the problem shows up. Therefore, is is sufficient to downgrade qtconsole

conda install qtconsole=5.1.1

to fix the problem.

Upvotes: 4

Related Questions