Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unable to pip install spacy [model] due to proxy issue

Tags:

python

spacy

I am trying to install a specific Spacy model "en_core_web_sm". I am unable to do this due to proxy server limitations I am having in my env that I have no control over.

I am using the following command as advised in their documentation: https://github.com/explosion/spacy-models

pip install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.1.0/en_core_web_sm-2.1.0.tar.gz

I figured the other way is to manually download the zip and copy it to the appropriate directory. I am unable to figure out where to place these files in my Anaconda setup to make it work.

Can someone suggest where I can put these files or propose an alternative?

(I have done set proxy etc etc and it works for plenty of other libraries, even installing Spacy itself but this specific model refuses to install)

like image 747
ravecoder Avatar asked Apr 24 '19 14:04

ravecoder


1 Answers

You are behind the proxy and are you able to download the model directly from the release in your browser. First Download the tar file.

https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.tar.gz

The .tar.gz archive is the same file that's downloaded during spacy download, and its an installable Python package. So if you have the file, you can also do the following:

pip install /path/to/en_core_web_sm-2.0.0.tar.gz

You should then be able to use the model like this:

import spacy

nlp = spacy.load('en_core_web_sm')

You can also download other spacy model in same way Or you can also use proxy in pip install but it not work in my case.

pip --proxy <proxy> https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.1.0/en_core_web_sm-2.1.0.tar.gz
like image 189
Mahendra S. Chouhan Avatar answered Sep 19 '22 01:09

Mahendra S. Chouhan