Skip to content

osx backend not usable with ipython/jupyter from conda? #14013

@tiagopereira

Description

@tiagopereira

Bug report

Bug summary

I am unable to use the osx backend from matplotlib with ipython or jupyter from conda (miniconda or anaconda, makes no difference). Since the alternative qt backend is suffering from the critical #13066 issue, this is quite important.

Code for reproduction

Python from conda does not appear to be installed as a framework, and this gives an error when trying to use the osx backend from ipython or jupyter. I followed the instructions on the error message (reinstall python.app), but I still get the same problem (see below). If I use pythonw and run things from there, the backend works fine. But there is no ipythonw to mimic the same behaviour. How are we supposed to use the osx backend from ipython? Or any modern backend? The Qt backend suffers from from the critical #13066 issue, which leads to hanging ipython sessions after a few minutes of use for me.

%matplotlib osx

Actual outcome

~/anaconda3/lib/python3.7/site-packages/matplotlib/backends/backend_macosx.py in <module>
     12
     13 import matplotlib
---> 14 from matplotlib.backends import _macosx
     15
     16 from .backend_agg import FigureCanvasAgg

ImportError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are using (Ana)Conda please install python.app and replace the use of 'python' with 'pythonw'. See 'Working with Matplotlib on OSX' in the Matplotlib FAQ for more information.

Expected outcome

No error.

Matplotlib version

  • Operating system: macOS 10.13.6
  • Matplotlib version: 3.0.3
  • Matplotlib backend (print(matplotlib.get_backend())): osx
  • Python version: 3.7.3
  • Jupyter version (if applicable): 1.0.0
  • Other libraries: ipython 7.4.0

Matplotlib and python from anaconda or miniconda (defaults or conda-forge, makes no difference).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions