0
我剛開始用NLTK,當我嘗試安裝裝配與NLTK在VS2012 IDE 蟒蛇第一我運行:Python和VS2012
import nltk
nltk.download()
它運行correctly.Then我嘗試:
from nltk.book import *
它給我:
Traceback (most recent call last):
File "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensio
ns\Microsoft\Python Tools for Visual Studio\2.1\visualstudio_py_util.py", line 1
06, in exec_file
exec_code(code, file, global_variables)
File "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensio
ns\Microsoft\Python Tools for Visual Studio\2.1\visualstudio_py_util.py", line 8
1, in exec_code
code_obj = compile(code, file, 'exec')
File "C:\Users\Toshiba\Documents\Visual Studio 2012\Projects\Helloworld\Hellow
orld\module2.py", line 2
NLTK_DADA ="E:\NLtk\nltk_data"
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in positio
n 2-3: malformed \N character escape
Press any key to continue . . .