所以我下载并安装了matplotlib。 奇怪的是,当我把它们放在home / user / Desktop中的时候,我可以很好地运行这些例子,但是当我将它们移动到home / user / Documents时,它们停止工作,我收到下面的消息。 有什么特别的文件文件夹,他们阻止matplotlib导入?
Traceback (most recent call last): File "contour_manual.py",line 4,in <module> import matplotlib.pyplot as plt File "/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.py",line 23,in <module> from matplotlib.figure import figure,figaspect File "/usr/local/lib/python2.7/dist-packages/matplotlib/figure.py",line 18,in <module> from axes import Axes,subplotBase,subplot_class_factory File "/usr/local/lib/python2.7/dist-packages/matplotlib/axes.py",line 8454,in <module> subplot = subplot_class_factory() File "/usr/local/lib/python2.7/dist-packages/matplotlib/axes.py",line 8446,in subplot_class_factory new_class = new.classobj("%ssubplot" % (axes_class.__name__),AttributeError: 'module' object has no attribute 'classobj'
RuntimeError:无效的disPLAYvariables
Tkinter / matplotlib osx上的多个活动窗口
禁用Python / Matplotlib的OpenGL
在Python 2.6中导入Pylab的问题
我该如何解决这个错误? Gtk-WARNING **:GModule …初始化检查失败:GLib版本太旧(微不匹配)
你的Documents文件夹中有没有文件new.py ? 如果有,请尝试将其重命名为其他内容。
matplotlib模块的axes.py导入new的文件,如果你的Documents文件夹中有一个new.py文件,那么Python会加载它,而不是内置的new模块。