【发布时间】:2016-03-16 14:38:31
【问题描述】:
我刚刚在 CentOS 服务器上安装了 nltk。但是当我进入 python 并尝试导入 nltk 时,出现以下错误。
有什么想法吗?
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/site-packages/nltk/__init__.py", line 114, in <module>
from nltk.collocations import *
File "/usr/lib/python2.6/site-packages/nltk/collocations.py", line 38, in <module>
from nltk.util import ngrams
File "/usr/lib/python2.6/site-packages/nltk/util.py", line 1361
d = {k: _default_to_regular(v) for k, v in d.items()}
【问题讨论】:
-
NLTK 不再支持 python 2.6。您必须降级 NLTK 或升级您的 python =)
-
我现在面临同样的错误。
标签: python centos nltk python-2.6 dictionary-comprehension