Cannot change to a different GUI toolkit: notebook - Warning in Jupyter

Christian Weber picture Christian Weber · Oct 8, 2018 · Viewed 9.9k times · Source

I want to use the interactive plots in jupyter, but when switching the backend to notebook, I get the warning: Warning: Cannot change to a different GUI toolkit: notebook. Using qt5 instead.

This happens on Windows 10, Anaconda 1.8.7, jupyter 5.5.0, python 3.6.5 and matplotlib 2.2.2.

Minimal working example:

import matplotlib.pyplot as plt
%matplotlib notebook

Output:

Warning: Cannot change to a different GUI toolkit: notebook. Using qt5 instead.

I found some question here where the problem is the other way around, but could not find anyone having this problem yet. In some cases, importing ipympl is mentioned as a solution, but this does not change anything in my case.

Any hints?

Answer

Christian Weber picture Christian Weber · Oct 11, 2018

As ImportanceOfBeingErnest pointed out in the comments, my problem was related to the backend already being set when jupyter starts. However, as mentioned in this post, the backend needs to be set in the ipython_config.py, not the jupyter_notebook_config.py.

After restarting the notebook server, I can switch between backends as described here.