import matplotlib.pyplot 时报错
import matplotlib.pyplot as pltTraceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import matplotlib.pyplot as plt
File "D:\Python\lib\site-packages\matplotlib\pyplot.py", line 40, in <module>
from matplotlib.figure import Figure, figaspect
File "D:\Python\lib\site-packages\matplotlib\figure.py", line 20, in <module>
from matplotlib import backends, docstring, projections
File "D:\Python\lib\site-packages\matplotlib\projections\__init__.py", line 4, in <module>
from mpl_toolkits.mplot3d import Axes3D
ModuleNotFoundError: No module named 'mpl_toolkits.mplot3d'
导入matplotlib没有问题,但是导入pyplot就报错,mpl_toolkits模块也安装了
卸载重装试试吧:
卸载:
pip uninstall matplotlib
安装:
python -m pip install matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple
困扰我半天 ,太谢谢了
页:
[1]