SYSTEM$RESOLVE_PYTHON_PACKAGES
functiondeferredUDFs, procedures, tasks, alerts, scriptingReturns a list of the resolved dependencies and their versions for the Python packages that were specified. This function works with packages from both Anaconda and Artifact Repository (PyPI).
Syntax
supportedpartialnot supportednot scored
SYSTEM$RESOLVE_PYTHON_PACKAGES( '<python_version>', '<package_spec_string>' [ , '<artifact_repository_name>' ] )
Parameters
| Name | Required | Description |
|---|---|---|
python_version | required | String specifying the version of the Python runtime (e.g., ’3.12’). |
package_spec_string | required | String containing package specifications in PACKAGES clause format, for example, $$('numpy', 'pandas')$$. Use $$()$$ to return only base packages (Python runtime and its dependencies). |
artifact_repository_name | required | Optional. String specifying the artifact repository name (e.g., ‘snowflake.snowpark.pypi_shared_repository’). If not provided or empty, uses the default Anaconda repository. |
Returns
Returns a JSON array that contains the resolved packages and their dependencies. Each element in the array is a string in the following format: <package_name>==<version_name>. The result always includes base packages (e.g., Python runtime and system libraries).
Usage notes
- Unlike SHOW_PYTHON_PACKAGES_DEPENDENCIES, which only works with Anaconda packages, SYSTEM$RESOLVE_PYTHON_PACKAGES works with packages from both Anaconda and Artifact Repository (PyPI).
- The function creates a temporary UDF internally to resolve package dependencies and automatically cleans it up.
- Use this function when you need to determine all dependencies for packages that will be included in a packages policy.
Access control requirements
This function can be called by any user. No special privileges are required.
See also
- SHOW_PYTHON_PACKAGES_DEPENDENCIES - Returns dependencies for Anaconda packages only (requires ACCOUNTADMIN role) - Packages policies - Packages policies for Python - Using third-party packages - Using Python packages in UDFs
Known gaps
- The emulator has no Anaconda channel catalog to resolve Python package requirements against; handler packages are installed from PyPI on demand instead.