在Python 2.6中导入Pylab时出现问题 [英] Problem Importing Pylab in Python 2.6

查看:96
本文介绍了在Python 2.6中导入Pylab时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Ubuntu 10.10中使用Python 2.6.我已经在 Python 解释器中运行了 help("modules") 并安装了 pylab 和 matplotlib.

I'm using Python 2.6 in Ubuntu 10.10. I've run help("modules") in the Python interpreter and pylab and matplotlib are installed.

但是,当我运行 import pylab 时,我收到以下错误消息.

However, when I run import pylab, I get the following error message.

>>> import pylab
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/pymodules/python2.6/pylab.py", line 1, in <module>
    from matplotlib.pylab import *
  File "/usr/lib/pymodules/python2.6/matplotlib/pylab.py", line 206, in <module>
    from matplotlib import mpl  # pulls in most modules
  File "/usr/lib/pymodules/python2.6/matplotlib/mpl.py", line 3, in <module>
    from matplotlib import axes
  File "/usr/lib/pymodules/python2.6/matplotlib/axes.py", line 7928, in <module>
    Subplot = subplot_class_factory()
  File "/usr/lib/pymodules/python2.6/matplotlib/axes.py", line 7920, in subplot_class_factory
    new_class = new.classobj("%sSubplot" % (axes_class.__name__),
AttributeError: 'module' object has no attribute 'classobj'

我不知道发生了什么或如何解决它.

I don't know what's happening or how to fix it.

感谢任何帮助.

推荐答案

http://old.nabble.com/scipy,-matplotlib-import-errors-td16343711.html

您在某个地方有一个new.py?

You have a new.py somewhere?

这篇关于在Python 2.6中导入Pylab时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆