Home > Net >  Remove en_core_web_trf .whl file after installing it in spacy
Remove en_core_web_trf .whl file after installing it in spacy

Time:05-25

I am using spacy and after installing all the dependencies, I use this command:

spacy download en_core_web_trf

I am running this command while creating a Docker image. I want to reduce the size of the Docker image. I know that when I install dependencies using following command:

pip install --no-cache-dir -r requirements.txt 

I have used --no-cache-dir option in order to disable (or clean) the cache of the package manager pip. Now I am confused that how can I also delete the en_core_web_trf .whl file after installing this dependency in order to reduce the Docker image size. The size of the en_core_web_trf .whl is almost 450 - 500 MB. That's why I want to delete it. Can anyone tell me what changes or what additional option I will have to add in the following command in order to delete en_core_web_trf .whl as soon as it is installed.

spacy download en_core_web_trf

CodePudding user response:

download command will install the package en_core_web_trf via pip. And you can locate where packages are installed in site-packages. So all you need to do is find where site-packages on your system e.g /usr/lib/python3.7/site-packages/en_core_web_trf

CodePudding user response:

If you aren't using pip's cache the .whl file should not be saved.

The model itself is still large and will take up significant space on disk. Perhaps that's what you're seeing? Those files are necessary to use the model, but if you want to remove them you can pip uninstall en_core_web_trf.

  • Related