Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
MostafaHosseinian opened this issue Nov 29, 2023 · 4 comments
Labels
documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged.

Comments

@MostafaHosseinian
Copy link

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

@MostafaHosseinian MostafaHosseinian added documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged. labels Nov 29, 2023
@MostafaHosseinian MostafaHosseinian changed the title ImportError ImportError: cannot import name 'is_s3express_bucket' from 'botocore.utils' Nov 29, 2023
@nateprewitt
Copy link
Contributor

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!

Copy link

⚠️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.

@MostafaHosseinian
Copy link
Author

Yes, I'm on Lambda.

@vhosakot
Copy link

vhosakot commented May 17, 2024

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

3 participants