python报错:ImportError: Failed to import any qt binding解决办法

打开pycharm运行程序,报错:ImportError: Failed to import any qt binding(如下所示)

Traceback (most recent call last):
  File "C:/Users/tymot/Desktop/myenv3/env/Tensorflow/all_good.py", line 15, in <module>
    import matplotlib.pyplot as plt
  File "C:\Users\tymot\Anaconda1\lib\site-packages\matplotlib\pyplot.py", line 115, in <module>
    _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
  File "C:\Users\tymot\Anaconda1\lib\site-packages\matplotlib\backends\__init__.py", line 62, in pylab_setup
    [backend_name], 0)
  File "C:\Users\tymot\Anaconda1\lib\site-packages\matplotlib\backends\backend_qt5agg.py", line 15, in <module>
    from .backend_qt5 import (
  File "C:\Users\tymot\Anaconda1\lib\site-packages\matplotlib\backends\backend_qt5.py", line 19, in <module>
    import matplotlib.backends.qt_editor.figureoptions as figureoptions
  File "C:\Users\tymot\Anaconda1\lib\site-packages\matplotlib\backends\qt_editor\figureoptions.py", line 20, in <module>
    import matplotlib.backends.qt_editor.formlayout as formlayout
  File "C:\Users\tymot\Anaconda1\lib\site-packages\matplotlib\backends\qt_editor\formlayout.py", line 54, in <module>
    from matplotlib.backends.qt_compat import QtGui, QtWidgets, QtCore
  File "C:\Users\tymot\Anaconda1\lib\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

 解决方法:在cmd窗口依次输入下列命令,即可解决上述问题。

pip uninstall matplotlib
python -m pip install --upgrade pip
pip install matplotlib

 

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值