Add Anaconda packages to a notebook¶
Deprecated
Sharing individual notebooks with application_content.notebooks shares
Legacy Notebooks, and is deprecated. Starting
August 18, 2026, you can’t create new application packages that share notebooks this way. Starting
November 2026, Legacy Notebooks can no longer be run or edited. For the full timeline, see
Disable Legacy Notebook creations.
Share Snowflake Notebooks in Workspaces in a workspace instead. Consumers can run and interact with those notebooks the same way, and a workspace can also share documentation, images, and sample data files. For more information, see Share a workspace in a Declarative Native App.
This topic applies only to Legacy Notebooks shared with application_content.notebooks. Notebooks
shared in a workspace install their Python packages at run time with !pip install, so they don’t
need an environment.yml file or an Anaconda package list. For more information, see
Install Python packages in a shared notebook.
The notebook environment includes a set of pre-installed Anaconda packages, such as Python and Streamlit.
If your notebook uses additional Anaconda packages, you must add those packages to your application package so that your notebook can access them.
You can add them while editing the notebook in development mode. You can also add the packages by providing an environment.yml file.
Note
If an environment.yml file is present in the same directory as a notebook, it overwrites the list of dependent packages, and any packages added through the Snowsight UI are ignored.
Using an environment.yml file is recommended for production applications as it allows you to manage dependencies in source control.
Using the UI is convenient for interactive development and testing.
Adding Anaconda packages while editing the notebook in development mode¶
You can add Anaconda packages to your notebook while editing it in development mode. We recommend using this method rather than adding packages to the environment.yml file, because the process is considerably simpler.
To add packages while editing the notebook:
- Install your application package locally from the live version.
- Sign in to Snowsight.
- In the navigation menu, select Projects » Notebooks.
- Open your notebook file.
- Make sure the notebook is in development mode. For information about development mode, see Editing Notebooks in Declarative Shared Native Applications.
- Select the Packages button in the top center of the notebook editor.
- Search for the package you want to add, and select it.
The notebook environment now automatically loads the selected dependencies when the notebook is run.
Adding Anaconda packages to the environment.yml file¶
You can define your Python dependencies by creating an environment.yml file, and uploading it to the same stage directory as your notebook (.ipynb) file.
For information about creating an environment.yml file that includes your new packages, see
Manage packages by using the environment.yml file
Note
You can only install packages listed in the Snowflake Anaconda Channel. Streamlit in Snowflake does not support external Anaconda channels.
Use the PUT command to upload your environment.yml file from your local machine to the application package stage. The environment.yml file must be in the same directory on the stage as the notebook file it configures.
Replace the placeholders in the following command with your own values. If your notebook is at the root of the live version, do not include a directory path after live/.