7
votes

I installed Python 3.7 on macOS 10.14 using Miniconda from here. My workflow uses iPython to run scripts that generate plots with Matplotlib. In my iPython configuration file ipython_config.py, I have the following settings to properly render figure windows on the Mac:

c.InteractiveShellApp.gui = 'osx'
c.InteractiveShellApp.matplotlib = 'osx'

When I run iPython in the terminal, the following error appears:

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.

I did not receive this error when using Matplotlib 2.2.3.

The Matplotlib 3.0 documentation states that a framework build of Python (referred to as pythonw) is needed when using Conda and Matplotlib. I installed this with conda install python.app. The documentation then says to use pythonw instead of python. But how do I tell iPython to use pythonw?

1
I am having the same problem. This seems to be a long-standing, unresolved issue of anaconda on OSX (github issue). I am at the same point as you are. - fakufaku
Try pythonw -m ipython - shadowtalker
@shadowtalker that does not work.. it just says 'no module named ipython' even from a conda env where IPython is verifiably actually installed. For whatever reason, pythonw (installed as python.app via conda) cannot locate IPython. - ely

1 Answers

3
votes

Typing

echo "backend: TkAgg" > ~/.matplotlib/matplotlibrc

in a terminal fixed IPython for me.