Install spaCy in a self-contained environment, including specified language models. For macOS and Linux-based systems, this will also install Python itself via a "miniconda" environment, for spacy_install. Alternatively, an existing conda installation may be used, by specifying its path. The default setting of "auto" will locate and use an existing installation automatically, or download and install one if none exists.

For Windows, automatic installation of miniconda installation is not currently available, so the user will need to miniconda (or Anaconda) manually.

If you wish to install Python ion a "virtualenv", use the spacy_install_virtualenv function.

spacy_install(conda = "auto", version = "latest", lang_models = "en",
  python_version = "3.6", envname = "spacy_condaenv",
  python_path = NULL, prompt = TRUE)

spacy_install_virtualenv(version = "latest", lang_models = "en",
  python_version = "3.6", python_path = NULL, prompt = TRUE)

Arguments

conda

character; path to conda executable. Default "auto" which automatically find the path

version

character; spaCy version to install. Specify "latest" to install the latest release, or "latest_v1" to install the latest release of spaCy v1.*. See spaCy Version Issues.

You can also provide a full major.minor.patch specification (e.g. "1.1.0")

lang_models

character; language models to be installed. Default en (English model). A vector of multiple model names can be used (e.g. c("en", "de")). A list of available language models and their names is available from the spaCy language models page.

python_version

character; determine Python version for condaenv installation. 3.5 and 3.6 are available.

envname

character; name of the conda-environment to install spaCy. Default is "spacy_condaenv".

python_path

character; path to Python in virtualenv installation

prompt

logical; ask whether to proceed during the installation

spaCy Version Issues

The version options currently default to the latest spaCy v2 (version = "latest"). As of 2018-04, however, some performance issues affect the speed of the spaCy pipeline for spaCy v2.x relative to v1.x. This can enormously affect the performance of spacy_parse(), especially when a large number of small texts are parsed. For this reason, the spacyr provides an option to automatically install the latest version of spaCy v1.*, using version = "latest_v1".

Examples

# NOT RUN {
# install spaCy in a miniconda environment (macOS and Linux)
spacy_install(lang_models = c("en", "de"), prompt = FALSE)

# install spaCy to an existing conda environment
spacy_install(conda = "~/anaconda/bin/")
# }
# NOT RUN { # install spaCy in a virtualenv environment spacy_install_virtualenv(lang_models = c("en")) # }