解决python ImportError: Failed to import any qt binding

转载自:https://blog.csdn.net/someonelikesyou/article/details/104974528
问题:如题。

解决方法:

  1. 重新安装,或降低版本matplotlib
#重新安装
python -m pip uninstall matplotlib
python -m pip install --upgrade pip
python -m pip install matplotlib
 
#降低版本
python -m pip uninstall matplotlib
python -m pip --no-cache-dir install -U matplotlib==2.2.2

我的python版本3.6,重新安装毫无卵用, 安装2.2.2matplotlib 可以。
2. 出现新的问题:

ImportError: Matplotlib qt-based backends require an external PyQt4, PyQt5,
PySide or PySide2 package to be installed, but it was not found.
解决方法:

查看是否安装PyQt5

import PyQt5

如果不能import,则安装PyQt5

python -m pip install PyQt5
  1. 安装后仍出现2中的问题,应该是缺少PySide
  2. 解决方法:

安装PySide

python -m pip install -U PySide
  1. 安装PySide时报错:

Complete output (1 lines):
only these python versions are supported: [(2, 6), (2, 7), (3, 2), (3, 3), (3, 4)]

应该是PySide与python3.6或者PyQt5不兼容,em…

解决方法:

安装PySide2

python -m pip install -U PySide2

em…解决问题

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值