b
b
bamboolib
Search…
How to setup bamboolib on Amazon SageMaker

Installation for Jupyter Notebook (see below for JupyterLab)

1. Go to the Amazon SageMaker UI​

2. Create a Lifecycle Configuration

Go to Notebook β†’ Create lifecycle configuration and create a lifecycle configuration called install-bamboolib. Copy paste the script below:
1
#!/bin/bash
2
sudo -u ec2-user -i <<'EOF'
3
​
4
# This will affect only the Jupyter kernel called "conda_python3"
5
# see <https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-lifecycle-config-install.html>
6
source activate python3
7
​
8
pip install bamboolib
9
python -m bamboolib install_nbextensions
10
​
11
source deactivate
12
​
13
EOF
Copied!

3. Create a Jupyter Notebook Instance

Go to Notebook β†’ Notebook Instances and create a notebook instance. Make sure to add the install-bamboolib lifecycle configuration under Lifecycle configuration

4. Open Notebook and test bamboolib

Click on "Open Jupyter" in order to start a Jupyter Notebook. Please make sure to create a Notebook with the conda_python3 kernel. Then run the following code to test bamboolib:
1
import bamboolib as bam
2
df = bam.get_sales_df()
3
df
Copied!

Installation for JupyterLab

SageMaker uses JupyterLab version 1.2.18, which is causing some compatibility issues with bamboolib. If you want us to provide compatibility for SageMaker JupyterLab, please send us an email.