{"action":"opened","issue":{"url":"https://api.github.com/repos/jupyter/notebook/issues/3684","repository_url":"https://api.github.com/repos/jupyter/notebook","labels_url":"https://api.github.com/repos/jupyter/notebook/issues/3684/labels{/name}","comments_url":"https://api.github.com/repos/jupyter/notebook/issues/3684/comments","events_url":"https://api.github.com/repos/jupyter/notebook/issues/3684/events","html_url":"https://github.com/jupyter/notebook/issues/3684","id":332222443,"node_id":"MDU6SXNzdWUzMzIyMjI0NDM=","number":3684,"title":"%matplotlib attempts to activate OS-specific backend","user":{"login":"dbrnz","id":239220,"node_id":"MDQ6VXNlcjIzOTIyMA==","avatar_url":"https://avatars2.githubusercontent.com/u/239220?v=4","gravatar_id":"","url":"https://api.github.com/users/dbrnz","html_url":"https://github.com/dbrnz","followers_url":"https://api.github.com/users/dbrnz/followers","following_url":"https://api.github.com/users/dbrnz/following{/other_user}","gists_url":"https://api.github.com/users/dbrnz/gists{/gist_id}","starred_url":"https://api.github.com/users/dbrnz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbrnz/subscriptions","organizations_url":"https://api.github.com/users/dbrnz/orgs","repos_url":"https://api.github.com/users/dbrnz/repos","events_url":"https://api.github.com/users/dbrnz/events{/privacy}","received_events_url":"https://api.github.com/users/dbrnz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-14T01:46:46Z","updated_at":"2018-06-14T01:46:46Z","closed_at":null,"author_association":"NONE","body":"`%matplotlib` tries to activate the system specific backend (from `matplotlib.rcParamsOrig['backend']` and then remembers this. A subsequent `%matplotlib notebook` fails with \"Warning: Cannot change to a different GUI toolkit: notebook.\"\r\n\r\nThis is with Python 3.6.4 and notebook 5.4.1 under macOS.\r\n\r\n```python\r\n%matplotlib\r\n```\r\n    ---------------------------------------------------------------------------\r\n    RuntimeError                              Traceback (most recent call last)\r\n\r\n    <ipython-input-1-a49a4afc47c5> in <module>()\r\n    ----> 1 get_ipython().run_line_magic('matplotlib', '')\r\n    \r\n    ~/.pyenv/versions/3.6.4/lib/python3.6/site-packages/IPython/core/interactiveshell.py in run_line_magic(self, magic_name, line, _stack_depth)\r\n       2093                 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals\r\n       2094             with self.builtin_trap:\r\n    -> 2095                 result = fn(*args,**kwargs)\r\n       2096             return result\r\n       2097 \r\n\r\n    <decorator-gen-107> in matplotlib(self, line)\r\n\r\n    ~/.pyenv/versions/3.6.4/lib/python3.6/site-packages/IPython/core/magic.py in <lambda>(f, *a, **k)\r\n        185     # but it's overkill for just that one bit of state.\r\n        186     def magic_deco(arg):\r\n    --> 187         call = lambda f, *a, **k: f(*a, **k)\r\n        188 \r\n        189         if callable(arg):\r\n\r\n    ~/.pyenv/versions/3.6.4/lib/python3.6/site-packages/IPython/core/magics/pylab.py in matplotlib(self, line)\r\n         97             print(\"Available matplotlib backends: %s\" % backends_list)\r\n         98         else:\r\n    ---> 99             gui, backend = self.shell.enable_matplotlib(args.gui)\r\n        100             self._show_matplotlib_backend(args.gui, backend)\r\n        101 \r\n\r\n    ~/.pyenv/versions/3.6.4/lib/python3.6/site-packages/IPython/core/interactiveshell.py in enable_matplotlib(self, gui)\r\n       2976                 gui, backend = pt.find_gui_and_backend(self.pylab_gui_select)\r\n       2977 \r\n    -> 2978         pt.activate_matplotlib(backend)\r\n       2979         pt.configure_inline_support(self, backend)\r\n       2980 \r\n\r\n    ~/.pyenv/versions/3.6.4/lib/python3.6/site-packages/IPython/core/pylabtools.py in activate_matplotlib(backend)\r\n        305     matplotlib.rcParams['backend'] = backend\r\n        306 \r\n    --> 307     import matplotlib.pyplot\r\n        308     matplotlib.pyplot.switch_backend(backend)\r\n        309 \r\n\r\n    ~/.pyenv/versions/3.6.4/lib/python3.6/site-packages/matplotlib/pyplot.py in <module>()\r\n        113 ## Global ##\r\n        114 \r\n    --> 115 _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()\r\n        116 \r\n        117 _IP_REGISTERED = None\r\n\r\n    ~/.pyenv/versions/3.6.4/lib/python3.6/site-packages/matplotlib/backends/__init__.py in pylab_setup(name)\r\n         60     # imports. 0 means only perform absolute imports.\r\n         61     backend_mod = __import__(backend_name, globals(), locals(),\r\n    ---> 62                              [backend_name], 0)\r\n         63 \r\n         64     # Things we pull in from all backends\r\n\r\n    ~/.pyenv/versions/3.6.4/lib/python3.6/site-packages/matplotlib/backends/backend_macosx.py in <module>()\r\n         15 \r\n         16 import matplotlib\r\n    ---> 17 from matplotlib.backends import _macosx\r\n         18 \r\n         19 from .backend_agg import FigureCanvasAgg\r\n\r\n    RuntimeError: 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.\r\n\r\n```python\r\n%matplotlib notebook\r\n```\r\n    Warning: Cannot change to a different GUI toolkit: notebook. Using osx instead.\r\n```\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"dbrnz"}}