1

代码:

from matplotlib import animation

输出:

ImportError: cannot import name 'animation' from partially initialized module 'matplotlib' (most likely due to a circular import)

motplotlib 版本是 3.3.4

4

3 回答 3

2

simply update matplotlib using pip install --upgrade matplotlib worked for me.

于 2021-05-16T17:59:47.747 回答
0

进行全新安装:

pip uninstall matplotlib 
pip install matplotlib --force-reinstall --user
于 2021-12-16T19:35:29.460 回答
0

查到文件路径后终于解决了问题,我一直在用Anaconda的spyder,所以我用anaconda提示一遍又一遍卸载安装matplotlib,但是问题不是anaconda报错,而是python37空闲,似乎如果在空闲时安装了一个packege,spyder将首先运行那个(在我的情况下这是一个坏的),只需在python37空闲时删除matplotlib,问题终于解决了

于 2021-12-08T12:09:51.433 回答