matplot plot hangs

Andrew Z formisc at gmail.com
Tue Oct 31 19:40:26 EDT 2017


hello,
 learning python's plotting by using matplotlib with python35 on fedora 24
x86.

Installed matplotlib into user's directory.
tk, seemed to work -
http://www.tkdocs.com/tutorial/install.html#installlinux - the window shows
up just fine.
but when trying to run the simple plot (
https://matplotlib.org/examples/pylab_examples/simple_plot.html) the script
is hanging on;

plt.plot(t, s)

attempts to
matplotlib.interactive(True) didn't bring anything,

I do get an error while trying to switch the backend ( which is fine with me) :
plt.switch_backend('Qt4Agg')
>>> plt.switch_backend('Qt4Agg')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/az/.local/lib/python3.5/site-packages/matplotlib/pyplot.py",
line 231, in switch_backend
    _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
  File "/home/az/.local/lib/python3.5/site-packages/matplotlib/backends/__init__.py",
line 60, in pylab_setup
    [backend_name], 0)
  File "/home/az/.local/lib/python3.5/site-packages/matplotlib/backends/backend_qt4agg.py",
line 10, in <module>
    from .backend_qt4 import (
  File "/home/az/.local/lib/python3.5/site-packages/matplotlib/backends/backend_qt4.py",
line 18, in <module>
    from .qt_compat import QtCore, QtWidgets, _getSaveFileName, __version__
  File "/home/az/.local/lib/python3.5/site-packages/matplotlib/backends/qt_compat.py",
line 150, in <module>
    from PyQt4 import QtCore, QtGui
ImportError: *No module named 'PyQt4'*
>>> plt.switch_backend('Agg')
>>> plt.switch_backend('TkAgg')


summary:

 why i can't use tkAgg, and how can i troubleshoot the issue?

Thank you



More information about the Python-list mailing list