我正在尝试按照本教程将自然语言处理包 spaCy 安装到 python 3 anaconda 环境中,windows 8
我打开控制台,cd-ed 到我的站点包文件夹,激活环境,pip-ed 进行安装,一切似乎都很好,除了我无法在这里运行第二个命令
$ pip install spacy
$ python -m spacy.en.download
现在我可以成功加载包,但是当我运行下面的第二行时,出现以下错误
>>> from spacy.en import English #this works
>>> nlp = English() #this doesn't
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\garrett\Anaconda\envs\py3k\lib\site-packages\spacy\en\__init__.py", line 64, in __init__
get_lex_props=get_lex_props)
File "spacy/vocab.pyx", line 42, in spacy.vocab.Vocab.__init__ (spacy/vocab.cpp:2216)
OSError: Directory C:\Users\garrett\Anaconda\envs\py3k\lib\site-packages\spacy\en\data\vocab not found -- cannot load Vocab.
我认为这是因为我无法跑步python -m spacy.en.download
谁能告诉我python -m spacy.en.download
应该做什么?
任何人都可以提供如何在 anaconda 环境中安装 spaCy 的演练吗?
这是我在设置目录、激活 python env、运行命令后得到的错误。我尝试的前几次,我的 spyder 编辑器没有响应,我杀死了控制台,最近一次我得到了这个错误
$ cd C:\Users\garrett\Anaconda\envs\py3k\Lib\site-packages
$ C:\Users\garrett\Anaconda\envs\py3k\Lib\site-packages>activate py3k
$ [py3k] C:\Users\garrett\Anaconda\envs\py3k\Lib\site-packages>python -m spacy.en.download
Moving existing dir C:\Users\garrett\Anaconda\envs\py3k\Lib\site-packages\spacy\en\data to /tmp
Traceback (most recent call last):
File "C:\Users\garrett\Anaconda\envs\py3k\lib\runpy.py", line 160, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "C:\Users\garrett\Anaconda\envs\py3k\lib\runpy.py", line 73, in _run_code
exec(code, run_globals)
File ".\spacy\en\download.py", line 56, in <module>
plac.call(main)
File ".\plac_core.py", line 309, in call
cmd, result = parser_from(obj).consume(arglist)
File ".\plac_core.py", line 195, in consume
return cmd, self.func(*(args + varargs + extraopts), **kwargs)
File ".\spacy\en\download.py", line 51, in main
shutil.move(DEST_DIR, '/tmp')
File "C:\Users\garrett\Anaconda\envs\py3k\lib\shutil.py", line 521, in move
raise Error("Destination path '%s' already exists" % real_dst)
shutil.Error: Destination path '/tmp\data' already exists
感谢您提供的任何帮助或建议