X Tutup
Skip to content

On MacOS Sierra with IPython, inconsistent results with %gui, %matplotlib magic commands and --gui, and --matplotlib command-line options for ipython and qtconsole; complete failure of qtconsole inline figures #7812

@lukelbd

Description

@lukelbd

I have been having major issues with matplotlib and the various IPython environments (the terminal shell, qtconsole, and notebook). So, I decided to methodically go through different combinations of ipython and jupyter qtconsole options. Here are the maddeningly and fascinatingly inconsistent results, using either command-line arguments, magic commands after IPython loads, or some combination of both. I am using the Anaconda library and have re-installed and updated all relevant packages (qt, qtconsole, pyqt, matplotlib, etc.).

FOR IPYTHON TERMINAL:

GUI SPEC:

--gui=qt, %matplotlib qt: after trying to declare figure, get "missing 1 required positional argument: 'figure'" (....what?)

--gui=qt, --matplotlib=qt: get "no module named PyQt4"

--gui=qt, %matplotlib qt5: success; different window format than osx, with save dialogue offering filetype choice

--gui=qt, --matplotlib=qt5: success; same as above

--gui=qt, %matplotlib osx: success; window pops up as separate application

--gui=qt, --matplotlib=osx: QApplication window NEVER STARTS; fig appears as popup/part of terminal application, does not have its own "window"

NO GUI SPEC:

--matplotlib=qt5 OR %matplotlib qt5: success

--matplotlib=qt OR%matplotlib qt: get "no module named PyQt4"

--matplotlib=osx OR %matplotlib osx: QApplication window NEVER STARTS; fig appears as temporary popup

FOR JUPYTER QTCONSOLE using jupyter qtconsole -- (args follow)

GUI SPEC:

--gui=qt, %matplotlib qt5: get "RuntimeError: Cannot activate multiple GUI eventloops"

--gui=qt, --matplotlib=qt5: works, creates QApplication window for figures (seriously... WHAT? then why the hell doesn't %matplotlib qt5 work?)

--gui=qt, --matplotlib=inline OR %matplotlib inline: after trying to use plt.show(), get "matplotlib is currently using a non-GUI backend,"

--gui=qt, %matplotlib osx: get "RuntimeError: Cannot activate multiple GUI eventloops"

--gui=qt, --matplotlib=osx: works, but NO QApplication window; just a window-less popup

NO GUI SPEC:

--matplotlib=qt5 OR %matplotlib qt5: same as above, works

--matplotlib=osx OR %matplotlib osx: same as above, NO QApplication

--matplotlib=inline OR %matplotlib inline: after trying to use plt.show(), get "matplotlib is currently using a non-GUI backend,"

--matplotlib=qt: get "Eventloop or matplotlib integration failed. Is matplotlib installed?"

%matplotlib qt: get "no module named PyQt4"

FOR JUPYTER NOTEBOOK (no command-line options for notebook server, must specify in notebook cells)

%matplotlib inline: after trying to use plt.show(), get "matplotlib is currently using a non- GUI backend,"

%matplotlib notebook: works fine

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup