View source: R/is_python_package_with_version_installed.R
| is_python_package_with_version_installed | R Documentation |
Determine if a Python package with the right version is installed
is_python_package_with_version_installed( package_name, package_version, ormr_folder_name = get_default_ormr_folder_name(), python_version = get_default_python_version(), verbose = FALSE )
package_name |
the name of one Python package |
package_version |
a Python package's version, e.g.
|
ormr_folder_name |
can be either |
python_version |
the version of Python used. Use get_default_python_version to get the default Python version. |
verbose |
the verbosity of a function. Set to TRUE for more output. Use check_verbose to detect if this argument is valid. |
nothing
Richèl J.C. Bilderbeek
if (plinkr::is_on_ci()) {
if (is_conda_installed()) {
# Use Conda
ormr_folder_name <- create_default_conda_env()
} else {
# Use local python
ormr_folder_name <- "python3"
}
# Check for an exact version
is_python_package_with_version_installed(
ormr_folder_name = ormr_folder_name,
package_name = "pip",
package_version = "21.3.1"
)
is_python_package_with_version_installed(
ormr_folder_name = ormr_folder_name,
package_name = "pip",
package_version = "==21.3.1"
)
# Check for a range
is_python_package_with_version_installed(
ormr_folder_name = ormr_folder_name,
package_name = "pip",
package_version = "<=21.3.1"
)
is_python_package_with_version_installed(
ormr_folder_name = ormr_folder_name,
package_name = "pip",
package_version = ">=21.3.1"
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.