2013-07-29 119 views
3

導入Pearsonr我得到這個錯誤,當我試圖從scipy.stats進口pearsonr。錯誤,當我嘗試從scipy.stats

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' 

任何解決方案???

+0

可能有所幫助:http://stackoverflow.com/questions/5655314/problem-importing-pylab-in-python-2-6 – seth

回答

0

這可能是您有進口的,而不是需要一個一個new.py文件。