Set Up and Manage the User Environment | Natural Language Processing | Teradata Open Analytics Framework - Set Up and Manage the User Environment - Teradata VantageCloud Lake

Lake - Analyze Your Data with ClearScape Analytics™

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2026-02-20
dita:mapPath
tcl1683670667798.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
tcl1683670667798
  1. Explore the base environments offered on the target system.
    list_base_envs()

    Out:

           base_name  language version
    0     python_3.8   Python  3.8.18
    1     python_3.9   Python  3.9.18
    2    python_3.10   Python  3.10.13
    3          r_4.1        R   4.1.3
    4          r_4.0        R   4.0.5
    5          r_4.2        R   4.2.2
  2. Create a new R user environment from available base environment equipped with R 4.1.3.
    demo_env = create_env(env_name = 'tokenizers_r_env',
                          base_env = 'r_4.1.3',
                          desc = 'OpenAF Demo tokenizers Use Case Environment')
  3. Verify the new environment has been created.
    list_user_envs()

    Out:

    User environment 'tokenizers_r_env' created.
  4. Use the user environment handler to manage it and install the libraries needed for the analysis.
    1. View existing libraries in the user environment.
      demo_env.libs
    2. Install required R library, ‘tokenizers’, from the requirement file which will install any dependencies in the user environment.
      The requirement file must be specified in the install_lib() function by means of the file location in your filepath.
      The default value of the asynchronous parameter is False, which means you need to wait until installation is complete to proceed with the next statement. However, by specifying asynchronous=True, teradataml enables you to continue executing statements while installation takes place asynchronously in the background. Avoid using the libraries you request before installation is complete.
      claim_id = demo_env.install_lib(libs_file_path=os.path.join(path_to_reqsfiles, 'reqs_tokenizers_R.txt'), asynchronous=False)
    3. During the asynchronous installation, you can check the status by using the following API.
      demo_env.status(claim_id)
    4. Verify that required R libraries have been installed correctly.
      demo_env.libs()