python - %matplotlib qt does not work -


python 2.7.12 |anaconda 4.2.0 (64-bit)| spyder 3.0.1| ipython 5.1.0 (running on windows)

when asking plots in new window via:

%matplotlib qt 

i error:

traceback (most recent call last):    file "<ipython-input-2-6ad73d0e50c7>", line 1, in <module>     get_ipython().magic(u'matplotlib qt')    file "c:\anaconda2\lib\site-packages\ipython\core\interactiveshell.py", line 2158, in magic     return self.run_line_magic(magic_name, magic_arg_s)    file "c:\anaconda2\lib\site-packages\ipython\core\interactiveshell.py", line 2079, in run_line_magic     result = fn(*args,**kwargs)    file "<decorator-gen-105>", line 2, in matplotlib    file "c:\anaconda2\lib\site-packages\ipython\core\magic.py", line 188, in <lambda>     call = lambda f, *a, **k: f(*a, **k)    file "c:\anaconda2\lib\site-packages\ipython\core\magics\pylab.py", line 100, in matplotlib     gui, backend = self.shell.enable_matplotlib(args.gui)    file "c:\anaconda2\lib\site-packages\ipython\core\interactiveshell.py", line 2947, in enable_matplotlib     pt.activate_matplotlib(backend)    file "c:\anaconda2\lib\site-packages\ipython\core\pylabtools.py", line 295, in activate_matplotlib     matplotlib.pyplot.switch_backend(backend)    file "c:\anaconda2\lib\site-packages\matplotlib\pyplot.py", line 232, in switch_backend     _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()    file "c:\anaconda2\lib\site-packages\matplotlib\backends\__init__.py", line 32, in pylab_setup     globals(),locals(),[backend_name],0)    file "c:\anaconda2\lib\site-packages\matplotlib\backends\backend_qt4agg.py", line 18, in <module>     .backend_qt5agg import figurecanvasqtaggbase _figurecanvasqtaggbase    file "c:\anaconda2\lib\site-packages\matplotlib\backends\backend_qt5agg.py", line 16, in <module>     .backend_qt5 import qtcore    file "c:\anaconda2\lib\site-packages\matplotlib\backends\backend_qt5.py", line 31, in <module>     .qt_compat import qtcore, qtgui, qtwidgets, _getsavefilename, __version__    file "c:\anaconda2\lib\site-packages\matplotlib\backends\qt_compat.py", line 137, in <module>     pyqt4 import qtcore, qtgui  importerror: no module named pyqt4 

i think issue caused having qt_api environment variable still set pyqt4 (or pyside). check this, instance, typing import os; print(os.environ.get('qt_api')) in python prompt.

if case need remove or set pyqt5. google how set environment variable under windows if don't know how.


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -