私はPycharmをインストールし、Anaconda 3をインタープリタとして使用しました。私はMatplotlib(またはSeaborn)をインポートできません。私は「PLTとしてインポートmatplotlib.pyplot」を実行すると、私は、次を得る: -Pycharm - Matplotlibのインポート
import matplotlib.pyplot as plt
バックエンドQt5Aggは、対話型バックエンドです。対話モードをオンにします。上記の例外の取り扱い中
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2016.2.3\helpers\pydev\pydev_ipython\inputhook.py", line 502, in enable_gui gui_hook = guis[gui] KeyError: 'qt5'
、別の例外が発生しました:
Traceback (most recent call last): File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2016.2.3\helpers\pydev_pydev_bundle\pydev_ipython_console_011.py", line 123, in enable_gui return real_enable_gui(gui, app) File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2016.2.3\helpers\pydev\pydev_ipython\inputhook.py", line 508, in enable_gui raise ValueError(e) ValueError: Invalid GUI request 'qt5', valid ones are:dict_keys(['osx', 'gtk', 'qt4', 'qt', 'gtk3', 'glut', 'pyglet', 'wx', 'none', 'tk'])
を上記の例外の取り扱い時には、別の例外が発生しました:
Traceback (most recent call last): File "C:\Program Files\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2881, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 1, in import matplotlib.pyplot as plt File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2016.2.3\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) File "C:\Program Files\Anaconda3\lib\site-packages\matplotlib\pyplot.py", line 2512, in install_repl_displayhook() File "C:\Program Files\Anaconda3\lib\site-packages\matplotlib\pyplot.py", line 165, in install_repl_displayhook ip.enable_gui(ipython_gui_name) File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2016.2.3\helpers\pydev_pydev_bundle\pydev_ipython_console_011.py", line 125, in enable_gui raise UsageError("%s" % e) IPython.core.error.UsageError: Invalid GUI request 'qt5', valid ones are:dict_keys(['osx', 'gtk', 'qt4', 'qt', 'gtk3', 'glut', 'pyglet', 'wx', 'none', 'tk'])
このhttp://stackoverflow.com/questions/4930524/how-can-i-set-the-backend-in-matplotlib-in-pythonを参照してくださいqt4 – eyllanesc