[英]python2.7: matplotlib in jupyter notebook can't use qt
I've installed python2.7
and installed matplotlib
using pip.我已经安装了python2.7
并使用 pip 安装了matplotlib
。 When I execute:当我执行:
% matplotlib qt
It get the error:它得到错误:
No module named pyqt4, pyqt5...
So I installed pyqt4
using .whl
file, and the error becomes:所以我使用.whl
文件安装了pyqt4
,错误变为:
No module named pyqt5
I've searched that pyqt5
can be easy installed using pip3 install pyqt5
, but not for pip
.我已经搜索到pyqt5
可以使用pip3 install pyqt5
轻松安装,但不适用于pip
。
Also I remembered that I have solved this problem by downgrading jupyter
before but I can't remember it exactly.我还记得我之前通过降级jupyter
解决了这个问题,但我记不清了。
I have searched the web for a while but can't find a solution, how can I get rid of this error in a most simple way?我在网上搜索了一段时间,但找不到解决方案,如何以最简单的方式摆脱此错误?
There are different ways to specify the backend for matplotlib有多种方法可以为 matplotlib 指定后端
Set a environment variable in windows MPLBACKEND
with value as Qt4Agg
.在 Windows MPLBACKEND
设置一个环境变量,值为Qt4Agg
。
See this for more available backend看到这个更多可用的后端
https://matplotlib.org/tutorials/introductory/usage.html#what-is-a-backend https://matplotlib.org/tutorials/introductory/usage.html#what-is-a-backend
Also you can try %matplotlib qt4
instead of %matplotlib qt
你也可以尝试%matplotlib qt4
而不是%matplotlib qt
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.