ImportError: cannot import name 'is_s3express_bucket' from 'botocore.utils'

0

Hi,

A code on sagemaker pipeline script is throwing an error related to 'is_s3express_bucket'.

The code: subprocess.check_call([sys.executable, "-m", "pip", "install", "--upgrade", "awswrangler"]) subprocess.check_call([sys.executable, "-m", "pip", "install", "--upgrade", "sagemaker"]) #subprocess.check_call([sys.executable, "-m", "pip", "install", "--upgrade", "botocore"]) no change #subprocess.check_call([sys.executable, "-m", "pip", "install", "--upgrade", "boto3"]) no change subprocess.check_call([sys.executable, "-m", "pip", "install", "pandas==1.1.5"]) s3 = boto3.client('s3', region_name=region)

The error: ImportError: cannot import name 'is_s3express_bucket' from 'botocore.utils' (/miniconda3/lib/python3.7/site-packages/botocore/utils.py)

mkpd
asked 5 months ago3572 views
2 Answers
0
Accepted Answer

Hi,

Look at the accepted answer of https://repost.aws/it/questions/QU2l9P6ZEhSkSL0lFQonOHfQ/a-lambda-failed-to-start-with-the-error-cannot-import-name-is-s3express-bucket-from-botocore-utils

It seems to be very close to your own issue and they propose a way to solve it that works.

In that case, it was a version mismatch between boto3 and botocore comming from the lambda runtime.

Best,

Didier

profile pictureAWS
EXPERT
answered 5 months ago
profile picture
EXPERT
reviewed 2 months ago
  • Thank you for having accepted my amswer! Didier

0

Python 3.7 libraries are very old. You’ll be on old versions of boto.

Need to get to a newer version.

profile picture
EXPERT
answered 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions