SageMaker

The Map SDK can be used in Amazon SageMaker notebooks.

Overview

To access Jupyter Notebooks through Amazon SageMaker, navigate to the SageMaker dashboard, then click on "Notebook instances" in the left sidebar.

Click on Notebook Instances to access Jupyter Notebooks through SageMakerClick on Notebook Instances to access Jupyter Notebooks through SageMaker

Click on Notebook Instances to access Jupyter Notebooks through SageMaker

Then click on "Create notebook instance" to set up a computational environment, then choose either "Open Jupyter" or "Open JupyterLab" to start your Jupyter environment. Then follow the steps under Installation.

Installation

The installation methods differ depending on whether you chose "Open Jupyter" or "Open JupyterLab" from the "Notebook instances" page.

Jupyter (Jupyter Notebook)

There are two steps necessary:

  1. Installing the Notebook extension. This only needs to be done once.
  2. Installing the Python package into the Conda environment you use. This needs to be done once for each Conda environment you want to use.

Installing the Notebook extension

First, to install the Notebook extension, we'll use the default environment to enable the package. From the Jupyter Notebook home screen, choose New > Terminal.

SageMaker New DropdownSageMaker New Dropdown
Sagemaker Dropdown.Sagemaker Dropdown.

Sagemaker Dropdown.

Then inside the terminal run:

pip install unfolded.map-sdk
jupyter nbextension install --py --sys-prefix unfolded.map_sdk
jupyter nbextension enable --py --sys-prefix unfolded.map_sdk

Installing the Python package

Now open a notebook using a Python 3 environment. For example, choose New > conda_pytorch_p36. In the first cell, use !pip to install unfolded.map-sdk again:

!pip install unfolded.map-sdk

Following that, you should be able to display Studio maps in the notebook. Note that this pip install command only needs to be run once per Python environment. For example, the next time I create a notebook in the conda_pytorch_p36 environment I can run import unfolded.map-sdk without running !pip install again.

Jupyter Lab

There are two steps necessary:

  1. Installing the Lab extension. This only needs to be done once.
  2. Installing the Python package into the Conda environment you use. This needs to be done once for each Conda environment you want to use.

Installing the Lab extension

First, to install the Lab extension, we'll use the default environment to enable the package. From the JupyterLab home screen, choose Terminal.

SageMaker new terminal.SageMaker new terminal.

SageMaker new terminal.

Then inside the terminal run:

pip install unfolded.map-sdk
jupyter labextension install @jupyter-widgets/jupyterlab-manager @unfolded/jupyter-map-sdk

Installing the Python package

Now open a notebook using a Python 3 environment. For example, choose conda_python3. In the first cell, use !pip to install unfolded.map-sdk again:

!pip install unfolded.map-sdk

After this pip install, you must reload the JupyterLab page in your browser.

Following that, you should be able to display Studio maps in the notebook. Note that this pip install command only needs to be run once per Python environment. For example, the next time I create a notebook in the conda_pytorch_p36 environment I can run import unfolded.map-sdk without running !pip install again.

SageMaker pip install.SageMaker pip install.

SageMaker pip install.


Sign In