Categories:

System functions (System Information)

SHOW_PYTHON_PACKAGES_DEPENDENCIES

返回指定的 Python 包的依赖项及其版本的列表。

Note

This function only works for Anaconda (Conda) packages. To resolve dependencies for packages from Artifact Repository (PyPI) or to work with packages from both Anaconda and Artifact Repository, use the SYSTEM$RESOLVE_PYTHON_PACKAGES function instead.

For more information, see Packages policies.

语法

SNOWFLAKE.SNOWPARK.SHOW_PYTHON_PACKAGES_DEPENDENCIES( '<Python_runtime_version>', '<packages_list>' )

实参

Python_runtime_version

指定 Python 运行时版本的字符串。

packages_list

指定要检查的包列表的字符串 ARRAY。

You can use an ARRAY constant to specify this list.

返回

Returns a JSON array that contains the dependencies and their versions. Each element in the array is a string in the following format: <package_name>==<version_name>.

访问控制要求

您必须使用该 ACCOUNTADMIN 角色来调用此函数。

示例

The following example returns a list of the dependencies of the numpy Python package with the Python 3.10 runtime.

USE ROLE ACCOUNTADMIN;

select SNOWFLAKE.SNOWPARK.SHOW_PYTHON_PACKAGES_DEPENDENCIES('3.10', ['numpy']);

结果是依赖关系及其版本的列表。

['_libgcc_mutex==0.1', '_openmp_mutex==5.1', 'blas==1.0', 'ca-certificates==2023.05.30', 'intel-openmp==2021.4.0',
'ld_impl_linux-64==2.38', 'ld_impl_linux-aarch64==2.38', 'libffi==3.4.4', 'libgcc-ng==11.2.0', 'libgfortran-ng==11.2.0',
'libgfortran5==11.2.0', 'libgomp==11.2.0', 'libopenblas==0.3.21', 'libstdcxx-ng==11.2.0', 'mkl-service==2.4.0',
'mkl==2021.4.0', 'mkl_fft==1.3.1', 'mkl_random==1.2.2', 'ncurses==6.4', 'numpy-base==1.24.3', 'numpy==1.24.3',
'openssl==3.0.10', 'python==3.10', 'readline==8.2', 'six==1.16.0', 'sqlite==3.41.2', 'tk==8.6.12', 'xz==5.4.2', 'zlib==1.2.13']

另请参阅