You are on page 1of 2

These are codes to install and Connect Sagemaker locally on laptop/PC.

Note: install anaconda navigator and


First Create you Aws account and follow these steps before installing locally.
Create your Aws Account on Browser
Click on your profile name
Click on My Security Credential
Click on Access Keys (access key ID and secret acess key)
We will need this information later.
Note you can use root user or iam user depend on you
but for iam user you need to give it some permissions/policy:

AmazonEC2FullAccess
AmazonEC2ContainerRegistryFullAccess
AmazonS3FullAccess
AdministratorAccess
AmazonSageMakerFullAccess
AWSBillingReadOnlyAccess

### Now lets start with the installation ###

1. Create and open a new folder in which you want to install Sagemaker.( Better to
create one in C drive )
2. Open cmd in that folder and run following Comamnds.

python -m venv sagemaker # Creating envoirnment


.\sagemaker\Scripts\activate # activating envoirnment
pip install boto3 sagemaker pandas # installing Sagemaker SDK in envoirnment

### Better to install these libraries too(you can install them later also)

pip install tensorflow # installing tensorflow


pip install -U scikit-learn # installing Scikitlearn

### Now lets Connect with our Sagemaker, There are two ways to do that
#(a).awscli
#(b).aws-shell
### We can use any one of these, i will share both of there codes with github link

#(a).Installing and connecting with awscli

# https://aws.amazon.com/cli/
# https://github.com/aws/aws-cli

python -m pip install awscli # installing the aws-cli


# python -m pip install --upgrade awscli # don't need to run this command at the
moment
# if the cli won't open later
# then run these upgrade command to fix
that issue

aws configure # it will ask you(we downloaded this


information earlier)
# Access key : type your access key here
# Secret Access Key: type your Secrete
access key here
# region : us-east-1 (write the region
name your in)
# output format : json(better to leave
this cell empty)
#(b). Installing and connecting with awscli
(note if you already have done awscli steps you can skip these commands)

# https://github.com/awslabs/aws-shell

pip install aws-shell # installing the aws-shell


# pip install --upgrade aws-shell # don't need to run this command at the
moment
# if the shell won't open later
# then run these upgrade command to fix that
issue

aws-shell # Opening aws-shell


configure # it will ask you(we downloaded this
information earlier)
# Access key : type your access key here
# Secret Access Key: type your Secrete
access key here
# region : us-east-1 (write the region
name your in)
# output format : json(better to leave
this cell empty)

# press f10 or ctrl d to exit aws shell configuration

# We have Successfully installed and connected aws locally of laptop/pc:


# now lets add its path to jupyter notebook for easy Access.

pip install ipykernel # Installing kernal


python -m ipykernel install --user --name=sagemaker # Giving kernal a name

################################# End #################################

You might also like