libs | Manage files and libs in User Environment | Open Analytics Framework - libs - 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 libs class property to see a list of libraries installed in the remote user environment.

This function does not have parameter and returns pandas DataFrame containing libraries and their versions.

Example 1: libs property for Python environment

  • Create a remote Python user environment.
    >>> env = create_env('testenv', 'python_3.7.9', 'Test environment')
    User environment testenv created.
  • View existing libraries installed in this Python environment.
    >>> env.libs
             name version
    0         pip  20.1.1
    1  setuptools  47.1.0
  • Install additional Python libraries.
    >>> env.install_lib(['numpy','nltk>=3.3'])
    Request to install libraries initiated successfully in the remote user environment test_env. Check the status using status() with the claim id '1e23d244-3c88-401f-a432-277d72dc6835'.
    '1e23d244-3c88-401f-a432-277d72dc6835'
  • List libraries installed.
    >>> env.libs
             name version
    0        nltk   3.4.5
    1       numpy  1.21.6
    2         pip  20.1.1
    3  setuptools  47.1.0
    4         six  1.16.0

Example 2: libs property for R environment

  • Create a remote R user environment.
    >>> r_env = create_env('test_r_env', 'r_4.1', 'Test R environment')
    User environment 'test_r_env' created.
  • View existing libraries installed in this R environment.
    >>> r_env.libs
              name  version
    0   KernSmooth  2.23-20
    1         MASS   7.3-55
    2       Matrix    1.4-0
    3         base    4.1.3
    4         boot   1.3-28
    ..         ...      ...
    26    survival   3.2-13
    27       tcltk    4.1.3
    28       tools    4.1.3
    29       utils    4.1.3
  • Install additional R libraries.
    >>> r_env.install_lib(['dplyr','testthat==3.0.4'])
                                    Claim Id                File/Libs   Method Name   Stage              Timestamp  Additional Details
    0   3823217b-89ee-423c-9ed1-f72a6b6d0511    dplyr, testthat=3.0.4   install_lib  Started  2023-08-31T07:14:57Z
    1   3823217b-89ee-423c-9ed1-f72a6b6d0511    dplyr, testthat=3.0.4   install_lib Finished  2023-08-31T07:20:35Z
  • List libraries installed.
    >>> r_env.libs
              name  version
    0   KernSmooth  2.23-20
    1         MASS   7.3-55
    2       Matrix    1.4-0
    3         base    4.1.3
    ..         ...      ...
    9        dplyr    1.1.2
    ..         ...      ...
    58    testthat    3.0.4
    ..         ...      ...
    61       vctrs    0.6.3
    62       waldo    0.5.1
    63       withr    2.5.0

Example 3: lib property for conda environment

  • Create conda environment.
    >>> testenv_conda = create_env('testenv_conda', 'python_3.8', 'Test conda environment', conda_env=True)
    Conda environment creation initiated
    User environment 'testenv_conda' created.
  • View existing libraries installed.
    >>> testenv_conda.libs
                    name     version
    0      _libgcc_mutex         0.1
    1      _openmp_mutex         5.1
    2    ca-certificates  2023.12.12
    3   ld_impl_linux-64        2.38
    4             libffi       3.4.4
    5          libgcc-ng      11.2.0
    6            libgomp      11.2.0
    7       libstdcxx-ng      11.2.0
    8            ncurses         6.4
    9            openssl      3.0.12
    10               pip      23.3.1
    11            python      3.9.18
    12          readline         8.2
    13        setuptools      68.2.2
    14            sqlite      3.41.2
    15                tk      8.6.12
    16            tzdata       2023d
    17             wheel      0.41.2
    18                xz       5.4.5
    19              zlib      1.2.13
  • Install additional Python libraries.
    >>> testenv_conda.install_lib(['numpy','nltk>=3.3'])
                                   Claim Id   File/Libs/Model  Method Name     Stage             Timestamp Additional Details
    0  4e3d5cde-20fd-490f-981d-82fda578b2fd  numpy, nltk>=3.3  install_lib   Started  2024-01-31T17:56:15Z                  
    1  4e3d5cde-20fd-490f-981d-82fda578b2fd  numpy, nltk>=3.3  install_lib  Finished  2024-01-31T17:57:24Z   
  • List libraries installed.
    >>> testenv_conda.libs
                    name     version
    0      _libgcc_mutex         0.1
    1      _openmp_mutex         5.1
    2               blas         1.0
    3    ca-certificates  2023.12.12
    4              click       8.1.7
    5       intel-openmp    2023.1.0
    6             joblib       1.2.0
    7   ld_impl_linux-64        2.38
    8             libffi       3.4.4
    9          libgcc-ng      11.2.0
    10           libgomp      11.2.0
    11      libstdcxx-ng      11.2.0
    12               mkl    2023.1.0
    13       mkl-service       2.4.0
    14           mkl_fft       1.3.8
    15        mkl_random       1.2.4
    16           ncurses         6.4
    17              nltk       3.8.1
    18             numpy      1.26.3
    19        numpy-base      1.26.3
    20           openssl      3.0.12
    21               pip      23.3.1
    22            python      3.9.18
    23          readline         8.2
    24             regex   2023.10.3
    25        setuptools      68.2.2
    26            sqlite      3.41.2
    27               tbb    2021.8.0
    28                tk      8.6.12
    29              tqdm      4.65.0
    30            tzdata       2023d
    31             wheel      0.41.2
    32                xz       5.4.5
    33              zlib      1.2.13