Install a Specific Python Package and Return Its Version
Source:R/utils.R
install_python_package.Rd
This function checks for the Python interpreter's location (either specified by the user or automatically located), compares it with the current R session's Python setting, installs a specified Python package using the identified Python interpreter, and returns the package version and installation environment.
Usage
install_python_package(
package_name,
package_version = NULL,
python_path = Sys.which("python3")
)
Arguments
- package_name
The name of the Python package to install.
- package_version
The version of the Python package to install. If
NULL
, the latest version is installed.- python_path
The path to the Python interpreter to be used for installation. If not provided, it defaults to the result of
Sys.which("python3")
.