当我运行此代码时,我收到错误(如下):
import nltk
sentence = """At eight o'clock on Thursday morning"""
tokens = nltk.word_tokenize(sentence)
nltk.pos_tag(tokens)
追溯是:
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
nltk.pos_tag(tokens)
File "C:\Python27\lib\site-packages\nltk\tag\__init__.py", line 99, in pos_tag
tagger = load(_POS_TAGGER)
File "C:\Python27\lib\site-packages\nltk\data.py", line 605, in load
resource_val = pickle.load(_open(resource_url))
File "C:\Python27\lib\site-packages\numpy\__init__.py", line 171, in <module>
import random
File "C:\Python27\lib\site-packages\numpy\random\__init__.py", line 99, in <module>
from mtrand import *
ImportError: DLL load failed: The application has failed to start because its side-by- side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.
我正在运行带有IDLE的Python 2.7.4 64位,并且我在Windows 7上安装了numpy-1.7.1 64位。
mtrand导入有什么问题?谢谢你的帮助。