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

unable to download spacy models by cli commands #4135

Closed
adalisan opened this issue Aug 16, 2019 · 4 comments
Closed

unable to download spacy models by cli commands #4135

adalisan opened this issue Aug 16, 2019 · 4 comments
Labels
install Installation issues models Issues related to the statistical models third-party Third-party packages and services

Comments

@adalisan
Copy link

How to reproduce the behaviour

install conda package

conda install -c conda-forge spacy=2.0

Download models

> conda activate base
> python -m spacy download en
> 

Traceback (most recent call last):
  File "/nfs/mercury-12/u15/sadali/anaconda3/envs/tensorflow-1.5/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/nfs/mercury-12/u15/sadali/anaconda3/envs/tensorflow-1.5/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/nfs/mercury-12/u15/sadali/anaconda3/envs/tensorflow-1.5/lib/python3.6/site-packages/spacy/__main__.py", line 31, in <module>
    plac.call(commands[command], sys.argv[1:])
  File "/nfs/mercury-12/u15/sadali/anaconda3/envs/tensorflow-1.5/lib/python3.6/site-packages/plac_core.py", line 328, in call
    cmd, result = parser.consume(arglist)
  File "/nfs/mercury-12/u15/sadali/anaconda3/envs/tensorflow-1.5/lib/python3.6/site-packages/plac_core.py", line 207, in consume
    return cmd, self.func(*(args + varargs + extraopts), **kwargs)
  File "/nfs/mercury-12/u15/sadali/anaconda3/envs/tensorflow-1.5/lib/python3.6/site-packages/spacy/cli/download.py", line 31, in download
    shortcuts = get_json(about.__shortcuts__, "available shortcuts")
  File "/nfs/mercury-12/u15/sadali/anaconda3/envs/tensorflow-1.5/lib/python3.6/site-packages/spacy/cli/download.py", line 58, in get_json
    return r.json()
  File "/nfs/mercury-12/u15/sadali/anaconda3/envs/tensorflow-1.5/lib/python3.6/site-packages/requests/models.py", line 897, in json
    return complexjson.loads(self.text, **kwargs)
AttributeError: module 'simplejson' has no attribute 'loads'

Info about spaCy

  • spaCy version: 2.0.18
  • Platform: Linux-2.6.32-504.8.1.el6_lustre.x86_64-x86_64-with-redhat-6.6-Carbon
  • Python version: 3.6.8
  • Models: en
@ines ines added install Installation issues models Issues related to the statistical models third-party Third-party packages and services labels Aug 16, 2019
@ines
Copy link
Member

ines commented Aug 16, 2019

That's weird... I don't think this is related to or caused by spaCy, though. Looks like there's something wrong with the requests package installed in your environment:

 File "/nfs/mercury-12/u15/sadali/anaconda3/envs/tensorflow-1.5/lib/python3.6/site-packages/requests/models.py", line 897, in json
    return complexjson.loads(self.text, **kwargs)
AttributeError: module 'simplejson' has no attribute 'loads'

It sounds pretty similar to psf/requests#4842, which describes a problem if simplejson is installed. Maybe just try uninstalling simplejson?

@svlandeg
Copy link
Member

I would also add: I see you're using base environment - can you try first creating a new environment from scratch, activate that, and retry the commands?

@ines ines added the more-info-needed This issue needs more information label Aug 16, 2019
@adalisan
Copy link
Author

Regarding the conda env, the problem was for another environment. I just wrote source activate base for brevity
I don't think if I installed simplejson explicitly (only ujson was explicitly specified), maybe it was installed by a requirement.
I resolved the issue by a python one liner and made the call by plac.

@no-response no-response bot removed the more-info-needed This issue needs more information label Aug 22, 2019
@ines ines closed this as completed Aug 22, 2019
@lock
Copy link

lock bot commented Sep 21, 2019

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 Sep 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
install Installation issues models Issues related to the statistical models third-party Third-party packages and services
Projects
None yet
Development

No branches or pull requests

3 participants