Installing Models from pip with requirements.txt
I'm needing to install some of the non-default models in production and trying to use pip to do so automatically and I'm encountering some issues. I've tried installing models through pip both in a new virtual environment and on Cloud9 to see if this was some odd local issue.
Following the instructions in https://spacy.io/usage/models#section-production and including those lines in a requirements.txt file gives me:
https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.tar.gz#en_core_web_sm should either be a path to a local project or a VCS url beginning with svn+, git+, hg+, or bzr+.
Appending git+ to the url gives me
fatal: repository 'https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.tar.gz/' not found
I have the feeling I'm missing something obvious here and this should 'just work'. Any ideas?
Your Environment
- spaCy version: 2.0.3
- Platform: Darwin-14.5.0-x86_64-i386-64bit
- Python version: 3.6.3
I think, it might be a pip problem. Which version of pip do you use? Also, try to use such a link: https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.tar.gz#egg=en_core_web_sm
That link gives me the same error:
https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.tar.gz#egg=en_core_web_sm should either be a path to a local project or a VCS url beginning with svn+, git+, hg+, or bzr+
pip version is 9.0.1
So, I was able to reproduce the problem. The problem is in -e at the beggining of the line. Here you can see that editables in pip shouldn't be a link to archive by design. Try to remove this parameter, this should help. But I still cannot understand why it is present in the instruction.
Thanks for the report and sorry – I think the docs might actually contain a mistake here, and the -e shouldn't be there. Will fix this! Also thanks to @GreenRiverRUS for looking into this in more detail.
Using just the URL to the .tar.gz archive should work (see #1143) – so I'm confused why it still causes an error for you.
Excluding -e works for me. Thanks for the help @GreenRiverRUS, and followup @ines!
Yay, glad to hear you got it working! Already updated the docs on the site to use the correct syntax 😊
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.