boto / botocore

The low-level, core functionality of boto3 and the AWS CLI.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

MostafaHosseinian opened this issue · comments

Describe the issue

In aws sagemaker, I used to install 'sagemaker==2.183.0', 'xgboost==1.5.1', 'statsmodels=0.13.5', and 'fasttreeshap==0.1.6' to launch a post processing job for my ML model. As of today, I've faced an import issue regarding botocore as follows. I wonder if you could help me out.
FYI, I tried to downgrade botocore to 1.32.5, as before but the import error is still there.

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

Links

Hi @MostafaHosseinian, it looks like this is a duplicate of #3082. We'll track resolution of this issue there. If you don't mind confirming if you're on Lambda in that ticket, it will be helpful. Thanks!

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Yes, I'm on Lambda.

saw same error on mac when doing aws eks update-kubeconfig ... cli, and below steps fixed it for me on mac:

$ aws eks update-kubeconfig --name <AWS EKS cluster name> --region <AWS region>
Traceback (most recent call last):
  File "/usr/local/bin/aws", line 27, in <module>
    sys.exit(main())
  File "/usr/local/bin/aws", line 23, in main
    return awscli.clidriver.main()
  File "/Users/vhosakot/Library/Python/3.9/lib/python/site-packages/awscli/clidriver.py", line 69, in main
    driver = create_clidriver()
  File "/Users/vhosakot/Library/Python/3.9/lib/python/site-packages/awscli/clidriver.py", line 78, in create_clidriver
    load_plugins(session.full_config.get('plugins', {}),
  File "/Users/vhosakot/Library/Python/3.9/lib/python/site-packages/awscli/plugin.py", line 44, in load_plugins
    modules = _import_plugins(plugin_mapping)
  File "/Users/vhosakot/Library/Python/3.9/lib/python/site-packages/awscli/plugin.py", line 61, in _import_plugins
    module = __import__(path, fromlist=[module])
  File "/Users/vhosakot/Library/Python/3.9/lib/python/site-packages/awscli/handlers.py", line 78, in <module>
    from awscli.customizations.s3.s3 import s3_plugin_initialize
  File "/Users/vhosakot/Library/Python/3.9/lib/python/site-packages/awscli/customizations/s3/s3.py", line 15, in <module>
    from awscli.customizations.s3.subcommands import ListCommand, WebsiteCommand, \
  File "/Users/vhosakot/Library/Python/3.9/lib/python/site-packages/awscli/customizations/s3/subcommands.py", line 18, in <module>
    from botocore.utils import is_s3express_bucket, ensure_boolean
ImportError: cannot import name 'is_s3express_bucket' from 'botocore.utils' (/Users/vhosakot/Library/Python/3.9/lib/python/site-packages/botocore/utils.py)

# saw above error with below versions
$ pip3 list | grep 'aws\|boto\|s3'                               
awscli                     1.32.80
boto3                      1.28.38
botocore                   1.31.85
s3transfer                 0.6.2

below steps fixed it for me:

pip3 uninstall -y awscli boto3 botocore s3transfer
pip3 install awscli

# below command worked for me
aws eks update-kubeconfig --name <AWS EKS cluster name> --region <AWS region>