1

In Sagemaker Studio I created a new lifecycle configuration with a start up script that can set up a new environment with certain packages(BeautifulSoup for example). The script I wrote is as below:

#!bin/bash

set -eux

PACKAGE=BeautifulSoup

%pip install $PACKAGE

I then attached the above lifecycle configuration to my user profile and the same can be seen during setting up environment in Sagemaker studio as below. enter image description here

When I try to create the environment, "Starting notebook kernel.." is displayed for a few minutes and then I get a 127 Return code. enter image description here

I tried to follow the steps provided in this blog https://aws.amazon.com/blogs/machine-learning/customize-amazon-sagemaker-studio-using-lifecycle-configurations/ but I'm still unable to create a custom environment using script.

I suspect the error I'm getting could be because of the following reasons:

  1. Installation path is not right
  2. I have missed to activate the environment in the script

Please help!

1 Answers1

0

Your script has a number of issues you can use the below script:

#!/bin/bash

set -eux

PACKAGE=beautifulsoup4


pip install $PACKAGE                     

In general it is always good practice to test the script in a terminal before adding it as a Lifecycle script.

Marc Karp
  • 949
  • 4
  • 6