Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when getting list of package files in model setup.py on Windows (Python 3.6) #894

Closed
ruiEnca opened this issue Mar 19, 2017 · 4 comments
Labels
models Issues related to the statistical models windows Issues related to Windows

Comments

@ruiEnca
Copy link

ruiEnca commented Mar 19, 2017

After install Spacy 1.7.1 after download any model there is always a problem with the paths.

Traceback of the german model (the last I try):

python -m spacy download de

Downloading de_core_news_md-1.0.0/de_core_news_md-1.0.0.tar.gz

Collecting https://github.com/explosion/spacy-models/releases/download/de_core_news_md-1.0.0/de_core_news_md-1.0.0.tar.gz
Downloading https://github.com/explosion/spacy-models/releases/download/de_core_news_md-1.0.0/de_core_news_md-1.0.0.tar.gz (675.5MB)
100% |████████████████████████████████| 675.5MB 1.9kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Rui\AppData\Local\Temp\pip-5lr0w63j-build\setup.py", line 61, in
setup_package()
File "C:\Users\Rui\AppData\Local\Temp\pip-5lr0w63j-build\setup.py", line 54, in setup_package
package_data={model_name: list_files(model_dir)},
File "C:\Users\Rui\AppData\Local\Temp\pip-5lr0w63j-build\setup.py", line 30, in list_files
output = [p.split('/', 1)[1] for p in paths]
File "C:\Users\Rui\AppData\Local\Temp\pip-5lr0w63j-build\setup.py", line 30, in
output = [p.split('/', 1)[1] for p in paths]
IndexError: list index out of range

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in C:\Users\Rui\AppData\Local\Temp\pip-5lr0w63j-build
Traceback (most recent call last):
File "C:\Anaconda\lib\runpy.py", line 193, in run_module_as_main
"main", mod_spec)
File "C:\Anaconda\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Anaconda\lib\site-packages\spacy_main
.py", line 71, in
plac.Interpreter.call(CLI)
File "C:\Anaconda\lib\site-packages\plac_ext.py", line 1142, in call
print(out)
File "C:\Anaconda\lib\site-packages\plac_ext.py", line 914, in exit
self.close(exctype, exc, tb)
File "C:\Anaconda\lib\site-packages\plac_ext.py", line 952, in close
self.interpreter.throw(exctype, exc, tb)
File "C:\Anaconda\lib\site-packages\plac_ext.py", line 964, in make_interpreter
arglist = yield task
File "C:\Anaconda\lib\site-packages\plac_ext.py", line 1139, in call
raise
(task.etype, task.exc, task.tb)
File "C:\Anaconda\lib\site-packages\plac_ext.py", line 53, in raise

raise exc.with_traceback(tb)
File "C:\Anaconda\lib\site-packages\plac_ext.py", line 380, in wrap
for value in genobj:
File "C:\Anaconda\lib\site-packages\plac_ext.py", line 95, in gen_exc
raise
(etype, exc, tb)
File "C:\Anaconda\lib\site-packages\plac_ext.py", line 53, in raise

raise exc.with_traceback(tb)
File "C:\Anaconda\lib\site-packages\plac_ext.py", line 966, in make_interpreter
cmd, result = self.parser.consume(arglist)
File "C:\Anaconda\lib\site-packages\plac_core.py", line 207, in consume
return cmd, self.func(*(args + varargs + extraopts), **kwargs)
File "C:\Anaconda\lib\site-packages\spacy_main
.py", line 30, in download
cli_download(model, direct)
File "C:\Anaconda\lib\site-packages\spacy\cli\download.py", line 25, in download
link_package(model_name, model, force=True)
File "C:\Anaconda\lib\site-packages\spacy\cli\link.py", line 21, in link_package
pkg = importlib.import_module(package_name)
File "C:\Anaconda\lib\importlib_init_.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 978, in _gcd_import
File "", line 961, in _find_and_load
File "", line 948, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'de_core_news_md'

In the meanwhile I placed the model folder manually and it seems working.

Your Environment

Info about spaCy

  • spaCy version: 1.7.1
  • Platform: Windows-10-10.0.14393-SP0
  • Python version: 3.6.0
  • Installed models:
@ines ines added models Issues related to the statistical models windows Issues related to Windows labels Mar 19, 2017
@ines
Copy link
Member

ines commented Mar 19, 2017

Thanks for the report!

This is interesting – it actually fails in the model's setup.py when putting together the list of package files. So the good news is, the spaCy code might be fine – but we'll definitely have to debug the model setup and rebuild and reupload the files.

I'm glad this came up, though. [p.split('/', 1)[1] for p in paths] seems like a very brittle way to compile a list of paths, so this needs to be fixed regardless.

@ines ines changed the title Error downloading the new models with version 1.7.1 Error when getting list of package files in model setup.py on Windows (Python 3.6) Mar 19, 2017
@GruffPrys
Copy link

Happened to me too:

C:\Users\user\Downloads>pip install https://github.com/explosion/spacy-models/releases/download/en_core_web_md-1.2.0/en_core_web_md-1.2.0.tar.gz
Collecting https://github.com/explosion/spacy-models/releases/download/en_core_web_md-1.2.0/en_core_web_md-1.2.0.tar.gz
Downloading https://github.com/explosion/spacy-models/releases/download/en_core_web_md-1.2.0/en_core_web_md-1.2.0.tar.gz (1086.4MB)
100% |################################| 1086.4MB 738bytes/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\user\AppData\Local\Temp\pip-f2c13r4e-build\setup.py", line 61, in
setup_package()
File "C:\Users\user\AppData\Local\Temp\pip-f2c13r4e-build\setup.py", line 54, in setup_package
package_data={model_name: list_files(model_dir)},
File "C:\Users\user\AppData\Local\Temp\pip-f2c13r4e-build\setup.py", line 30, in list_files
output = [p.split('/', 1)[1] for p in paths]
File "C:\Users\user\AppData\Local\Temp\pip-f2c13r4e-build\setup.py", line 30, in
output = [p.split('/', 1)[1] for p in paths]
IndexError: list index out of range

spaCy 1.7.1, Win 10, Python 3.5

Thanks for spaCy, enjoying playing around with it :)

@ines
Copy link
Member

ines commented Mar 20, 2017

Just rebuilt and reuploaded all models with an updated setup.py.

Pretty sure the cause of this issue on Windows was the old code snippet using a hard-coded / to compile paths (duh). Sorry about that. You should be able to download and install models properly now – if not, feel free to reopen.

@ines ines closed this as completed Mar 20, 2017
@lock
Copy link

lock bot commented May 9, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
models Issues related to the statistical models windows Issues related to Windows
Projects
None yet
Development

No branches or pull requests

3 participants