L、Gj 发表于 2020-7-4 16:07:14

import matplotlib.pyplot 时报错

import matplotlib.pyplot as plt

Traceback (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模块也安装了

Twilight6 发表于 2020-7-4 16:08:52




卸载重装试试吧:

卸载:
pip uninstall matplotlib
安装:
python -m pip install matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple


L、Gj 发表于 2020-7-4 16:15:32

困扰我半天 ,太谢谢了
页: [1]
查看完整版本: import matplotlib.pyplot 时报错