Using artifact repositories¶
You can use Snowflake Artifact Repository to install third-party packages in your notebooks.
This preview lets you use Snowflake’s default PyPI Artifact Repository to install PyPI packages with support for package policies.
The Snowflake PyPI repo is a schema-level, RBAC-governed object: snowflake.snowpark.pypi_shared_repository.
Privilege requirements¶
By default, the PUBLIC role has access to the Snowflake PyPI repo. To manage privileges, use the following commands:
Using artifact repositories in Snowsight¶
You can use artifact repositories in both interactive sessions and scheduled notebooks.
Interactive sessions¶
-
Go to Workspaces > Notebooks.
-
Edit or create a new notebook service.
-
Choose
snowflake.snowpark.pypi_shared_repositoryfrom the Artifact Repository dropdown menu. -
Select Create and connect.
-
Install packages by using a Python cell:
Scheduled notebooks¶
In the Scheduling dialog, choose snowflake.snowpark.pypi_shared_repository from the Artifact Repository
dropdown menu.
Note
If you’ve selected an artifact repository in the notebook service, you can only install packages from that repository, not through any external access integrations (EAIs).
Setting the default repository¶
An ACCOUNTADMIN can use a parameter to set the Snowflake PyPI repo as the default. The default repo is automatically selected in the Artifact Repository dropdown, but users can still select a different repository if they have access.
This is an account-level parameter that applies to the notebook service dialogs for all users.
Headless execution with SQL¶
When you use the EXECUTE NOTEBOOK PROJECT command in scheduling and production workloads, include the ARTIFACT_REPOSITORIES parameter as an optional argument.
Note
If both EXTERNAL_ACCESS_INTEGRATIONS and ARTIFACT_REPOSITORIES parameters are specified, packages are only installed from the artifact repositories.