【发布时间】:2013-06-21 23:28:05
【问题描述】:
我正在尝试从matplotlib documentation 运行contourf 示例。 当我从 python shell 运行它时,一切正常,但是当我将它作为脚本(python contourf_demo.py)运行时,出现以下错误:
Traceback(最近一次调用最后一次):
文件“matplotlib.py”,第 3 行,在
将 matplotlib.pyplot 导入为 plt
文件“/home/user/dir/contourf_demo.py”,第 3 行,在
将 matplotlib.pyplot 导入为 plt
ImportError: 没有名为 pyplot 的模块
我用的是Ubuntu 12.04,导入时出现问题:
将 matplotlib.pyplot 导入为 plt
我尝试过使用不同的方式来调用导入(例如 from matplotlib import pyplot),但它也不起作用。
【问题讨论】:
标签: python matplotlib