1

I am new in python and having difficulty trying to get spacy to interface in R. So I used this at command line

 python -m spacy download en_core_web_md

Its about 1GB in size and at the end of it it tries to install en_core_web_md but somehow I got loads of error messages

Exception:
Traceback (most recent call last):
  File "C:\Users\mydir\AppData\Local\Continuum\Anaconda3\lib\site-packages\pi
p\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "C:\Users\mydir\AppData\Local\Continuum\Anaconda3\lib\site-packages\pi
p\commands\install.py", line 324, in run
    requirement_set.prepare_files(finder)
  File "C:\Users\mydir\AppData\Local\Continuum\Anaconda3\lib\site-packages\pi
p\req\req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "C:\Users\mydir\AppData\Local\Continuum\Anaconda3\lib\site-packages\pi
p\req\req_set.py", line 634, in _prepare_file
    abstract_dist.prep_for_dist()
  File "C:\Users\mydir\AppData\Local\Continuum\Anaconda3\lib\site-packages\pi
p\req\req_set.py", line 129, in prep_for_dist
    self.req_to_install.run_egg_info()
  File "C:\Users\mydir\AppData\Local\Continuum\Anaconda3\lib\site-packages\pi
p\req\req_install.py", line 417, in run_egg_info
    self.setup_py, self.link,
  File "C:\Users\mydir\AppData\Local\Continuum\Anaconda3\lib\site-packages\pi
p\req\req_install.py", line 387, in setup_py
    import setuptools  # noqa
  File "C:\Users\mydir\AppData\Local\Continuum\Anaconda3\lib\site-packages\se
tuptools\__init__.py", line 10, in <module>
    from setuptools.extern.six.moves import filter, map
  File "C:\Users\mydir\AppData\Local\Continuum\Anaconda3\lib\site-packages\se
tuptools\extern\__init__.py", line 1, in <module>
    from pkg_resources.extern import VendorImporter
  File "C:\Users\mydir\AppData\Local\Continuum\Anaconda3\lib\site-packages\pk
g_resources\__init__.py", line 3039, in <module>
    @_call_aside
  File "C:\Users\mydir\AppData\Local\Continuum\Anaconda3\lib\site-packages\pk
g_resources\__init__.py", line 3023, in _call_aside
    f(*args, **kwargs)
  File "C:\Users\mydir\AppData\Local\Continuum\Anaconda3\lib\site-packages\pk
g_resources\__init__.py", line 3052, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "C:\Users\mydir\AppData\Local\Continuum\Anaconda3\lib\site-packages\pk
g_resources\__init__.py", line 649, in _build_master
    ws = cls()
  File "C:\Users\mydir\AppData\Local\Continuum\Anaconda3\lib\site-packages\pk
g_resources\__init__.py", line 642, in __init__
    self.add_entry(entry)
  File "C:\Users\mydir\AppData\Local\Continuum\Anaconda3\lib\site-packages\pk
g_resources\__init__.py", line 698, in add_entry
    for dist in find_distributions(entry, True):
  File "C:\Users\mydir\AppData\Local\Continuum\Anaconda3\lib\site-packages\pk
g_resources\__init__.py", line 1953, in find_eggs_in_zip
    if metadata.has_metadata('PKG-INFO'):
  File "C:\Users\mydir\AppData\Local\Continuum\Anaconda3\lib\site-packages\pk
g_resources\__init__.py", line 1467, in has_metadata
    return self.egg_info and self._has(self._fn(self.egg_info, name))
  File "C:\Users\mydir\AppData\Local\Continuum\Anaconda3\lib\site-packages\pk
g_resources\__init__.py", line 1827, in _has
    return zip_path in self.zipinfo or zip_path in self._index()
  File "C:\Users\mydir\AppData\Local\Continuum\Anaconda3\lib\site-packages\pk
g_resources\__init__.py", line 1707, in zipinfo
    return self._zip_manifests.load(self.loader.archive)
  File "C:\Users\mydir\AppData\Local\Continuum\Anaconda3\lib\site-packages\pk
g_resources\__init__.py", line 1647, in load
    mtime = os.stat(path).st_mtime
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'C:\\
Users\\mydir\\AppData\\Local\\Continuum\\Anaconda3\\lib\\site-packages\\setup
tools-27.2.0-py3.5.egg'
ImportError: No module named 'en_core_web_md'

What do I need to do to re-try without downloading the file again?

Thank you

PeddiePooh
  • 403
  • 8
  • 17
  • Run pip list or pip freeze to check which model packages you have installed – Pravitha V Jul 30 '17 at 08:19
  • Based on the error, it looks like this might be an issue with `setuptools` on Anaconda. Did any of the suggestions in this thread work for you? https://stackoverflow.com/questions/42755160/cannot-find-file-setuptools-27-2-0-py3-5-egg – Ines Montani Jul 30 '17 at 08:25
  • you think i need to downgrade by Anaconda? – PeddiePooh Jul 30 '17 at 08:36
  • so i have upgraded setuptools as you recommended, plz can you advice how to reinstall the above without downloading it again? – PeddiePooh Jul 30 '17 at 08:38
  • If the model download was successful, you can check if it's still in the pip cache. See here for instructions: https://stackoverflow.com/questions/34578168/where-is-pip-cache-folder If you do have to re-download, you can also download the model archive directly [from here](https://github.com/explosion/spacy-models) and then install it manually by pointing `pip install` to the archive on your local file system. In spaCy v2.0 (currently in alpha), this will be a lot easier btw – the models are _much_ smaller, e.g. 15 MB for the default English model. – Ines Montani Jul 30 '17 at 12:28

0 Answers0