Fix python - spacy package issue in anaconda environment

I am trying to follow this tutorial to install spaCy natural language processing package in pacon 3 anaconda environment, windows 8

I opened the console, cd-ed to the folder of my package site, the activated environment, pip-ed for installation, everything seemed fine, except that I could not run the second command here

$ pip install spacy
$ python -m spacy.en.download

Now I can successfully download the package, but when I run the second line below, I get the following error

>>> 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.

I think this is due to the fact that I could not run python -m spacy.en.download

Can someone give me an idea of ​​what python -m spacy.en.downloadshould do?

Can someone give a step-by-step guide on how to install spaCy in anaconda environment?

, , 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

,

+4
1

, ​​ . -, spacy , ( , ). /temp/data .

+1

All Articles