I am running sagemaker for the first time from my laptop. When I try to start the session I get this error ValueError: Must setup local AWS configuration with a region supported by SageMaker
Local config is set to eu-west-1 which is supported by Sagemaker.
I changed the region to us-west-2 and back and nothing changed. Of course I restarted the notebook kernel after each change just in case.
import boto3
import re
import os
import numpy as np
import pandas as pd
import sagemaker as sage
boto_session = boto3.Session(profile_name="bennu")
session = sage.Session(boto_session=boto_session) #this is where the error appears
I expect the session to start and to move on to the next step. The full notebook is here https://github.com/PacktPublishing/Hands-On-Machine-Learning-Using-Amazon-SageMaker-v-/blob/master/section_1/train_and_deploy_your_first_model_on_sagemaker.ipynb
You need to set the Region in the config file as asked by AWS documentation. You can find the location here:
~/.aws/config on Linux, macOS, or Unix
C:\Users\USERNAME\.aws\config on Windows
This file should contain lines in the following format:
[default]
region = your_aws_region
Example, in my case, it needs to be region = ap-southeast-2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With