hopsworks.environment #
Environment #
Returned by
description property #
Description of the environment.
name property #
Name of the environment.
python_version property #
Python version of the environment.
delete #
delete()
Delete the environment.
Potentially dangerous operation
This operation deletes the python environment.
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
install_requirements #
install_requirements(
path: str,
await_installation: bool | None = True,
timeout: float | None = None,
)
Install libraries specified in a requirements.txt file.
import hopsworks
project = hopsworks.login()
# Upload to Hopsworks
ds_api = project.get_dataset_api()
requirements_path = ds_api.upload("requirements.txt", "Resources")
# Install
env_api = project.get_environment_api()
env = env_api.get_environment("my_custom_environment")
env.install_requirements(requirements_path)
| PARAMETER | DESCRIPTION |
|---|---|
path | The path in Hopsworks where the TYPE: |
await_installation | If TYPE: |
timeout | Seconds to wait for the installation to finish before raising. Falls back to the engine's default when unset. It also bounds the wait for any environment command already in flight, which happens before the install is submitted and therefore applies even when TYPE: |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
install_wheel #
Install a python library packaged in a wheel file.
import hopsworks
project = hopsworks.login()
# Upload to Hopsworks
ds_api = project.get_dataset_api()
whl_path = ds_api.upload("matplotlib-3.1.3-cp38-cp38-manylinux1_x86_64.whl", "Resources")
# Install
env_api = project.get_environment_api()
env = env_api.get_environment("my_custom_environment")
env.install_wheel(whl_path)
| PARAMETER | DESCRIPTION |
|---|---|
path | The path in Hopsworks where the wheel file is located. TYPE: |
await_installation | If TYPE: |
timeout | Seconds to wait for the installation to finish before raising. Falls back to the engine's default when unset. It also bounds the wait for any environment command already in flight, which happens before the install is submitted and therefore applies even when TYPE: |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
uninstall #
uninstall(
library_name: str,
await_uninstallation: bool | None = True,
timeout: float | None = None,
) -> None
Uninstall a library from the environment.
import hopsworks
project = hopsworks.login()
env_api = project.get_environment_api()
env = env_api.get_environment("my_custom_environment")
env.uninstall("matplotlib")
| PARAMETER | DESCRIPTION |
|---|---|
library_name | Name of the installed library to remove. TYPE: |
await_uninstallation | If TYPE: |
timeout | Seconds to wait for the uninstallation to finish before raising. Falls back to the engine's default when unset. It also bounds the wait for any environment command already in flight, which happens before the removal is submitted and therefore applies even when TYPE: |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |