python nltk book_学习《Python自然语言处理》遇到问题:from nltk.book import *失败

补充说明:我的系统是win764位,python是2.7.9具体信息显示如下:>>>fromnltk.bookimport****IntroductoryExamplesfortheNLTKBook***Loadingtext1,...,text9andsent1,...,sent9Typeth...

补充说明:我的系统是win7 64位, python是2.7.9

具体信息显示如下:

>>> from nltk.book import *

*** Introductory Examples for the NLTK Book ***

Loading text1, ..., text9 and sent1, ..., sent9

Type the name of the text or sentence to view it.

Type: 'texts()' or 'sents()' to list the materials.

Traceback (most recent call last):

File "", line 1, in

File "D:\Program Files\Python27\lib\site-packages\nltk-3.0.2-py2.7.egg\nltk\bo

ok.py", line 22, in

text1 = Text(gutenberg.words('melville-moby_dick.txt'))

File "D:\Program Files\Python27\lib\site-packages\nltk-3.0.2-py2.7.egg\nltk\te

xt.py", line 295, in __init__

tokens = list(tokens)

File "D:\Program Files\Python27\lib\site-packages\nltk-3.0.2-py2.7.egg\nltk\co

rpus\reader\util.py", line 233, in __len__

for tok in self.iterate_from(self._toknum[-1]): pass

File "D:\Program Files\Python27\lib\site-packages\nltk-3.0.2-py2.7.egg\nltk\co

rpus\reader\util.py", line 282, in iterate_from

self._open()

File "D:\Program Files\Python27\lib\site-packages\nltk-3.0.2-py2.7.egg\nltk\co

rpus\reader\util.py", line 209, in _open

self._stream = self._fileid.open(self._encoding)

File "D:\Program Files\Python27\lib\site-packages\nltk-3.0.2-py2.7.egg\nltk\da

ta.py", line 496, in open

data = self._zipfile.read(self._entry)

File "D:\Program Files\Python27\lib\site-packages\nltk-3.0.2-py2.7.egg\nltk\da

ta.py", line 961, in read

self.close()

File "D:\Program Files\Python27\lib\zipfile.py", line 1386, in close

self._fpclose(fp)

File "D:\Program Files\Python27\lib\zipfile.py", line 1389, in _fpclose

assert self._fileRefCnt > 0

AssertionError

展开

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值