Installing and removing spaCy language models from Python code, without using the command line.
$ pip3 install git+https://github.com/rtmigo/spacy_installer_py#egg=spacy_installer
import spacy_installer
# load pre-installed model or install and load
model = spacy_installer.load_model('en_core_web_sm')
Or, install without loading.
import spacy_installer
# load pre-installed model or install and load
spacy_installer.install_model('en_core_web_sm')
import spacy_installer
spacy_installer.uninstall_model('en_core_web_sm')
Uninstall all models installed by the installer:
import spacy_installer
spacy_installer.uninstall_all_models()