Learn R Programming

rgee (version 0.5.0)

ee_install_python_packages: Install rgee Python packages dependencies (DEPRECATED)

Description

Install the necessary Python packages to be used in rgee. This function is a wrapper around reticulate::py_install(). Due to recent changes in reticulate it is no longer necessary. ee_install_python_packages and ee_install_earthengine_upgrade will be removed in rgee 0.5.3

Usage

ee_install_python_packages(
  method = c("auto", "virtualenv", "conda"),
  conda = "auto",
  ee_version = NULL,
  python_version = NULL,
  pip = FALSE,
  confirm = interactive(),
  ...
)

Arguments

method

Installation method. By default, "auto" automatically finds a method that will work in the local environment. Change the default to force a specific installation method. Note that the "virtualenv" method is not available on Windows.

conda

The path to a conda executable. Use "auto" to allow reticulate to automatically find an appropriate conda binary. See Finding Conda for more details.

ee_version

earthengine-api version to install. When this argument is NULL (the default), the version with which rgee was built will be installed.

python_version

The requested Python version. Ignored when attempting to install with a Python virtual environment.

pip

Logical. Use pip for package installation? This is only relevant when Conda environments are used, as otherwise packages will be installed from the Conda repositories.

confirm

Logical. Confirm if restart R when the 'install' argument is TRUE.

...

Additional arguments passed to conda_install or virtualenv_install.

Finding Conda

When conda = "auto", reticulate will attempt to automatically find an Anaconda / Miniconda installation and use that. reticulate will search the following locations:

  1. The location specified by the reticulate.conda_binary R option;

  2. The program PATH;

  3. A set of pre-defined locations where Conda is typically installed.

Details

It is neccessary restart R to observe change when installing Python packages. rgee only is compatible with Python version 3.5 >=. On Linux and OS X the "virtualenv" method will be used by default ("conda" will be used if virtualenv isn't available). On Windows, the "conda" method is always used.

See Also

reticulate::py_install()

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
#' library(rgee)

### rgee installation

# 1. Initialize rgee with ee_Initialize(). If there is no any Python
# environment, miniconda will be installed by default.
ee_Initialize()

# 2. Create a Python environment, e.g. ee.
pyenv <- ee_install_create_pyenv(py_env = "ee")

# Find others Python environments in the system.
ee_install_discover_pyenvs()

# 3. Set a Python environment (e.g. ee) and restart R to see changes.
ee_install_set_pyenv(pyenv, install = TRUE)

# 4. Install Python package dependencies and restart R to see changes.
ee_install_python_packages()

# 5. Initialize rgee again!
ee_Initialize()

# }

Run the code above in your browser using DataLab