get_env | Manage User Environments | Open Analytics Framework - get_env - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

Use the get_env to get an object of class UserEnv which represents an existing remote user environment created in Open Analytics Framework. The user environment can be created using create_env function.

This function is useful to get an object of existing user environment. The object returned can be used to perform further operations such as installing, removing files and libraries. See APIs to Manage Files and Libraries inside a User Environment.

Required Argument

env_name
Specifies the name of the existing remote user environment.

This function returns an object of class UserEnv representing the remote user environment.

Example

  • List available Python environments in Vantage.
    >>> list_base_envs()
       base_name      language  version
    0  python_3.6.11  Python   3.6.11
    1  python_3.7.9   Python   3.7.9
    2  python_3.8.5   Python   3.8.5
  • Create a Python 3.8.5 environment with given name and description in Vantage and get an object of class UserEnv.
    >>> test_env = create_env('test_env', 'python_3.8.5', 'Fraud detection through time matching')
    User environment 'test_env' created.
  • In a new teradataml session, use get_env() function to get an object pointing to the existing user environment created in the previous step, so that further opeartions, such as install files or libraries, can be performed.
    >>> test_env = get_env('test_env')