2

I would like to pip install several language models in a particular folder different than the default one.

How to proceed?

The following does not seem to work:

pip install /shared/public/spacy/en_core_web_lg-3.0.0-py3-none-any.whl

see: https://github.com/explosion/spacy-models/releases//tag/en_core_web_lg-3.0.0

With the typical installation procedure: python -m spacy download en_core_web_lg I can not control the folder.

the use case here is install the model in a folder available to everyone in a server in order to avoid multiple downloads.

NOTE: I already have Spacy installed in my particular virtual environment, i.e. I dont need to create a new one. Actually in my particular environment I do have the small language model of spacy for English. The question relates ONLY to installing yet another language model, the large one, in a particular folder, and being able to load that model from that folder.

thanks

JFerro
  • 3,203
  • 7
  • 35
  • 88

1 Answers1

0

you should use a python virtual environment (A python environment such that python interpreter). With virtual environment you can install any package apart from the default python path, which means all packages you will install will be isolated.

to make a python virtual environment in windows. open cmd and enter following

python -m venv path\that\you\want  (this will make a virtual environment)
path\that\you\entered\Scripts\activate.bat (to activate your virtual environment type path and \Scripts\activate.bat)

If you are in linux. Try following...

python3 -m venv path\to\your\venv (path that you want to make venv)
source path\to\your\venv\bin\activate (type path and \bin\activate)

then you can install python packages as usual with cmd\terminal

pip install spacy
Ethan Rodrigo
  • 315
  • 1
  • 8
  • 2
    Thanks @Ethan. I already have spacy installed in my Environment. My question relates only to the language model itself. – JFerro Apr 09 '21 at 09:09