- Assume you want to create a new Python user environment equipped with Python 3.10.
demo_env = create_env(env_name='py_keras_env', base_env='python_3.10', desc='py test env', conda_env=True)
User environment 'py_keras_env' created.
- Verify the new environment has been created.
list_user_envs()
env_name env_description base_env_name language conda 0 py_keras_env py test env python_3.10 Python True
- Use the user environment handler to manage the environmentt and install the libraries needed for the analysis.
- View existing libraries in the user environment.
demo_env.libs
name version 0 _libgcc_mutex 0.1 1 _openmp_mutex 5.1 2 bzip2 1.0.8 3 ca-certificates 2023.12.12 4 ld_impl_linux-64 2.38 5 libffi 3.4.4 6 libgcc-ng 11.2.0 7 libgomp 11.2.0 8 libstdcxx-ng 11.2.0 9 libuuid 1.41.5 10 ncurses 6.4 11 openssl 3.0.13 12 pip 23.3.1 13 python 3.10.13 14 readline 8.2 15 setuptools 68.2.2 16 sqlite 3.41.2 17 tk 8.6.12 18 tzdata 2023d 19 wheel 0.41.2 20 xz 5.4.5 21 zlib 1.2.13
- Install required Python libraries from the requirement file which will install any dependencies in the user environment. The libraries must be specified in the install_lib() function.
claim_id = demo_env.install_lib(['keras','protobuf','pandas','numpy > 1.26.2','scikit-learn'], asynchronous=False)
The default value of the asynchronous argument 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. - Check the status.
demo_env.status(claim_id)
- Verify the desired Python libraries have been installed correctly.
demo_env.libs
- View existing libraries in the user environment.