error message
ImportError: Failed to import any qt binding
complete error message:
Traceback (most recent call last):
File "/home/xovee/Desktop/codes/www20/plot/cascade_plot.py", line 1, in <module>
import matplotlib.pyplot as plt
File "/home/xovee/miniconda3/envs/tf-2.0-a0/lib/python3.6/site-packages/matplotlib/pyplot.py", line 2355, in <module>
switch_backend(rcParams["backend"])
File "/home/xovee/miniconda3/envs/tf-2.0-a0/lib/python3.6/site-packages/matplotlib/pyplot.py", line 221, in switch_backend
backend_mod = importlib.import_module(backend_name)
File "/home/xovee/miniconda3/envs/tf-2.0-a0/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/home/xovee/miniconda3/envs/tf-2.0-a0/lib/python3.6/site-packages/matplotlib/backends/backend_qt4agg.py", line 5, in <module>
from .backend_qt5agg import (
File "/home/xovee/miniconda3/envs/tf-2.0-a0/lib/python3.6/site-packages/matplotlib/backends/backend_qt5agg.py", line 11, in <module>
from .backend_qt5 import (
File "/home/xovee/miniconda3/envs/tf-2.0-a0/lib/python3.6/site-packages/matplotlib/backends/backend_qt5.py", line 15, in <module>
import matplotlib.backends.qt_editor.figureoptions as figureoptions
File "/home/xovee/miniconda3/envs/tf-2.0-a0/lib/python3.6/site-packages/matplotlib/backends/qt_editor/figureoptions.py", line 13, in <module>
from matplotlib.backends.qt_compat import QtGui
File "/home/xovee/miniconda3/envs/tf-2.0-a0/lib/python3.6/site-packages/matplotlib/backends/qt_compat.py", line 158, in <module>
raise ImportError("Failed to import any qt binding")
ImportError: Failed to import any qt binding
environment
- Ubuntu 18.4 LTS
- Python 3.6
- Matplotlib 3.1.1
solution
pip install PyQt5
<标题>引用
李- <> Foad。(2018年11月22日)。导入任何qt绑定、Python – Tensorflow失败。李从https://stackoverflow.com/questions/52346254/importerror-failed-to-import-any-qt-binding-python-tensorflow获取