Don't know how to uninstall unwanted Spacy installation, model

Gregg Williams picture Gregg Williams · Oct 29, 2018 · Viewed 8.2k times · Source

I have limited disk memory and want to know how to uninstall/remove files for spacy 2.xx under python 2.7 (I use python3 and think I've got spacy installed correctly for it). Ditto for the default model in my python3 install. Here's my terminal session:

gw-mac-pro:~ gr$ pip install -U spacy
Collecting spacy
  Downloading https://files.pythonhosted.org/packages/f8/db/490f0552f0f39eb3b75119
...
    Linking successful
    /usr/local/lib/python2.7/site-packages/en_core_web_sm -->
    /usr/local/lib/python2.7/site-packages/spacy/data/en

    You can now load the model via spacy.load('en')

gw-mac-pro:~ gr$ python -m spacy download en

Is there an uninstall script (I couldn't find one)? If not, can I just remove these directories? Do I need to remove files elsewhere?

New to spacy, obviously. Thanks for your help!

ADDED: I should have mentioned I'm on Mac OS (excuse me, macOS). I just found a command to show info on my spacy installation. Here's what it returns for python 2.7

gw-mac-pro:~ gr$ python -m spacy info

    Info about spaCy

    Python version     2.7.15
    Platform           Darwin-15.6.0-x86_64-i386-64bit
    spaCy version      2.0.16
    Location           /usr/local/lib/python2.7/site-packages/spacy
    Models             en

Answer

O.O.Balance picture O.O.Balance · Oct 30, 2018

spaCy installs models as packages (via pip). That means you can uninstall them via pip as well:

pip list

This shows you all the installed packages, including the spaCy models.

en-core-web-sm 2.0.0

pip uninstall en-core-web-sm

This will remove the en model.

Successfully uninstalled en-core-web-sm-2.0.0