Skip to content

hopsworks.environment #

[source] Environment #

[source] python_version property #

Python version of the environment.

[source] name property #

Name of the environment.

[source] description property #

Description of the environment.

[source] install_wheel #

install_wheel(
    path: str, await_installation: bool | None = True
) -> Library

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: str

await_installation

If True the method returns only when the installation finishes.

TYPE: bool | None DEFAULT: True

RETURNS DESCRIPTION
Library

The library object.

RAISES DESCRIPTION
hopsworks.client.exceptions.RestAPIError

If the backend encounters an error when handling the request.

[source] install_requirements #

install_requirements(
    path: str, await_installation: bool | None = True
) -> Library

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 requirements.txt file is located.

TYPE: str

await_installation

If True the method returns only when the installation is finished.

TYPE: bool | None DEFAULT: True

RETURNS DESCRIPTION
Library

The library object.

RAISES DESCRIPTION
hopsworks.client.exceptions.RestAPIError

If the backend encounters an error when handling the request.

[source] 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.