37,721
社区成员
发帖
与我相关
我的任务
分享
>>> text4.dispersion_plot(["citizens", "democracy", "freedom", "duties", "America"])
Traceback (most recent call last):
File "<pyshell#13>", line 1, in <module>
text4.dispersion_plot(["citizens", "democracy", "freedom", "duties", "America"])
File "D:\Program Files\Python27\lib\site-packages\nltk\text.py", line 456, in dispersion_plot
dispersion_plot(self, words)
File "D:\Program Files\Python27\lib\site-packages\nltk\draw\dispersion.py", line 27, in dispersion_plot
raise ValueError('The plot function requires the matplotlib package (aka pylab).'
ValueError: The plot function requires the matplotlib package (aka pylab).See http://matplotlib.sourceforge.net/
try:
import pylab
except ImportError:
raise ValueError('The plot function requires the matplotlib package (aka pylab).'
'See http://matplotlib.sourceforge.net/')
[/quote]
我就不知道怎么追查pylab了,出现不了
这个错误
我通过
import matplotlib.pyplot as plt
plt.plot([1,2,3])
plt.ylabel('some numbers')
plt.show()
也遇到了类似于缺少six.py的问题:
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import matplotlib.pyplot as plt
File "C:\Python27\lib\site-packages\matplotlib\pyplot.py", line 29, in <module>
from matplotlib.figure import Figure, figaspect
File "C:\Python27\lib\site-packages\matplotlib\figure.py", line 36, in <module>
from matplotlib.axes import Axes, SubplotBase, subplot_class_factory
File "C:\Python27\lib\site-packages\matplotlib\axes.py", line 20, in <module>
import matplotlib.dates as _ # <-registers a date unit converter
File "C:\Python27\lib\site-packages\matplotlib\dates.py", line 119, in <module>
from dateutil.rrule import (rrule, MO, TU, WE, TH, FR, SA, SU, YEARLY,
File "C:\Python27\lib\site-packages\dateutil\rrule.py", line 18, in <module>
from six import advance_iterator, integer_types
ImportError: No module named six
不知道您最后是怎么解决这个问题的,求帮助!