python安装matplotlib.pyplot_Python安装时import matplotlib.pyplot as plt报错 | 学步园

安装matplotlib的时候可能会出现输入import matplotlib.pyplot as plt出现报错的现象,如下图所示:

>>> import matplotlib

>>> import numpy

>>> import scipy

>>> import pyparsing

>>> import matplotlib.pyplot as plt

Traceback (most recent call last):

File "", line 1, in

import matplotlib.pyplot as plt

File "C:\Python27\Lib\site-packages\matplotlib\pyplot.py", line 29, in

from matplotlib.figure import Figure, figaspect

File "C:\Python27\Lib\site-packages\matplotlib\figure.py", line 36, in

from matplotlib.axes import Axes, SubplotBase, subplot_class_factory

File "C:\Python27\Lib\site-packages\matplotlib\axes.py", line 20, in

import matplotlib.dates as _  #

File "C:\Python27\Lib\site-packages\matplotlib\dates.py", line 119, in

from dateutil.rrule import (rrule, MO, TU, WE, TH, FR, SA, SU, YEARLY,

File "C:\Python27\Lib\site-packages\dateutil\rrule.py", line 18, in

from six import advance_iterator, integer_types

ImportError: No module named six

解决办法是:

把路径如:C:\Python27\Lib\site-packages\scipy\lib中的six.py six.pyc six.pyo三个文件拷贝到C:\Python27\Lib\site-packages目录下。

再在IDLE(Python GUI)中输入import matplotlib.pyplot as plt便可以解决啦!

如下所示:

>>> import matplotlib.pyplot as plt

>>>

  • 0
    点赞
  • 0
    收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
©️2022 CSDN 皮肤主题:数字20 设计师:CSDN官方博客 返回首页
评论
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值