When you author a notebook, the resources and Python libraries you use are made available through a notebook runtime. There are two runtimes available: the Standard runtime contains ArcGIS API for Python along with a few hundred other Python libraries, and the Advanced runtime contains all of the same libraries as well as ArcPy and some related libraries. The available runtimes depend on your licensing and privileges.
Note:
Notebooks that use the Advanced runtime can run ArcGIS API for Python and all other libraries from the Standard runtime.
To author notebooks, your administrator must assign you a custom member role that contains the appropriate privileges. Depending on the notebook runtime needed, you must be assigned the privilege for using the Standard runtime or the Advanced runtime. The Advanced runtime privilege also allows you to use the Advanced with GPU runtime.
Choose a notebook runtime
When you create a notebook, you choose which runtime the notebook will use. The list you choose from is based on your privileges, If you have been granted the Advanced Notebooks privilege, you can choose between Standard and Advanced runtimes. You can also change the runtime of a notebook after it has been created.
If you have the appropriate privileges, you may want to create notebooks using either runtime in different situations. For example, if you are authoring a notebook to share with other notebook authors in your organization who don't have the Advanced Notebooks privilege, you want to create a notebook using the Standard runtime.
Change a notebook runtime
It is recommended that you update the notebook runtime when a new version is available to take advantage of the latest available Python libraries.
Note:
Before changing the runtime for a notebook, review the available libraries and corresponding runtime versions used in the notebook. Some code may work differently with different versions of libraries. Some libraries are not available in all notebook runtimes. For example, ArcPy is only available in the Advanced notebook runtime, so if you switch to the Standard notebook runtime, an error will appear when you run cells in the notebook that use ArcPy.
Change a notebook's runtime from the item page
Follow these steps to change the runtime applied to an existing notebook in it's item page. This workflow can only be done by members who can author notebooks using either notebook runtime.
- Open the notebook's item page and click the Settings tab.
In the Notebook section of the tab, the Notebook runtime option designates the runtime the notebook is using.
- Click the drop-down list, and choose the runtime.
Note:
If you don't have the Advanced Notebooks privilege, only the Standard runtime appears in the drop-down list.
- Click Save to confirm.
Change notebook runtimes from the Notebooks home page
You can change the runtime applied to an existing notebook or multiple notebooks from the home page. These workflows can only be done by members who can author notebooks using either notebook runtime.
Change a single notebook's runtime from the home page
To change the runtime applied to an individual existing notebook from the home page, follow these steps:
- Open the Notebooks home page and click Options
> Update runtime on the notebook you want to update. - Select the new runtime from the drop-down menu.
- Click Update.
Change one or more notebook runtimes from the home page
To change the runtimes of multiple notebooks at once from the home page, follow these steps:
- Open the Notebooks home page and select one or more notebooks.
- Click Update runtime.
- Click All selected items to update all selected notebooks to the same runtime.
- Select the new runtime from the drop-down menu.
- Click Update.
- Click Each item to select the runtime for each selected notebook individually.
- Select the runtime for each notebook item.
- Click Update.
Install modules during a session
Notebook authors can make Python modules, or versions of modules, that are not included in either runtime available for use during a notebook session using the conda package management system. It is recommended that you use conda, because ArcGIS Notebooks uses it to manage modules.
This approach installs the desired module for the duration of the notebook session. Once the notebook is closed or the belonging to the user is terminated, the module is no longer available. To install modules using this method, you must have internet connectivity to the conda channel.
Note:
conda is included in the two notebook runtimes. You do not need to install it.
To install the scrapy package during a session, for example, run a notebook cell with one of the following commands, depending on the package management system you're using:
Using the conda package management system
!conda install --yes scrapyTo use a different version of a Python module in the notebook runtime you're working in, specify the version number in the command.
You must restart the kernel after running a conda command for your new package to be available.
For example, a certain package is available in both notebook runtimes at version 1.5, but you want to use a tool introduced in 1.6. To make version 1.6 of the package available during a notebook session, run a notebook cell with one of the following commands, depending on the package management system you're using:
Using the conda package management system
!conda install --yes <package name>==1.6