- 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
- 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')
- Verify the new environment has been created.
list_user_envs()
Out:
User environment 'tokenizers_r_env' created.
- Use the user environment handler to manage it and install the libraries needed for the analysis.
- View existing libraries in the user environment.
demo_env.libs
- 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)
- During the asynchronous installation, you can check the status by using the following API.
demo_env.status(claim_id)
- Verify that required R libraries have been installed correctly.
demo_env.libs()
- View existing libraries in the user environment.