I just created a virtual environment and installed matplotlib
and pyqt5
by pip
, but it seems that matplotlib didn’t use the Qt5Agg so that I can’t show any images by pyplot.show()
Python 3.9.7 (default, Oct 10 2021, 15:13:22)
[GCC 11.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib as mpl
>>> mpl.get_backend()
'agg'
>>>
my pip list in virtualenv:
Package Version
--------------- -------
cycler 0.11.0
kiwisolver 1.3.2
matplotlib 3.4.3
numpy 1.21.4
Pillow 8.4.0
pip 21.3.1
pyparsing 3.0.6
PyQt5 5.15.6
PyQt5-Qt5 5.15.2
PyQt5-sip 12.9.0
python-dateutil 2.8.2
setuptools 57.4.0
six 1.16.0
system: Archlinux 5.14
python version: 3.9.7
when I matplotlib in system python environment, the output of mpl.get_backend()
is : Qt5Agg
.
It just failed in my virtualenv.
What can I do to solve it?