我尝试从scipy.stats导入Pearsonr时出错

时间:2013-07-29 17:59:15

标签: python

当我尝试从scipy.stats导入pearsonr时出现此错误。

from scipy.stats import pearsonr

错误显示:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/scipy/stats/__init__.py", line 7, in <module>
from stats import *
File "/usr/lib/python2.7/dist-packages/scipy/stats/stats.py", line 198, in <module>
import distributions
File "/usr/lib/python2.7/dist-packages/scipy/stats/distributions.py", line 87, in <module>
from new import instancemethod
File "new.py", line 2, in <module>
import matplotlib.pyplot as plt
File "/usr/lib/pymodules/python2.7/matplotlib/pyplot.py", line 23, in <module>
from matplotlib.figure import Figure, figaspect
File "/usr/lib/pymodules/python2.7/matplotlib/figure.py", line 18, in <module>
from axes import Axes, SubplotBase, subplot_class_factory
File "/usr/lib/pymodules/python2.7/matplotlib/axes.py", line 8537, in <module>
Subplot = subplot_class_factory()
File "/usr/lib/pymodules/python2.7/matplotlib/axes.py", line 8529, in subplot_class_factory
new_class = new.classobj("%sSubplot" % (axes_class.__name__),
AttributeError: 'module' object has no attribute 'classobj'

任何解决方案???

1 个答案:

答案 0 :(得分:0)

您可能有一个正在导入的new.py文件而不是所需的文件。