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 'PROTOCOL_TLS' from 'urllib3.util.ssl_' (*****/urllib3/util/ssl_.py) #3811

Closed
kishorekumarhanbar opened this issue Aug 7, 2023 · 2 comments
Assignees
Labels
closed-for-staleness dependencies This issue is a problem in a dependency. response-requested Waiting on additional information or feedback.

Comments

@kishorekumarhanbar
Copy link

kishorekumarhanbar commented Aug 7, 2023

Describe the bug

Hi,

I am trying to use "import boto3" in my python code base, I am getting the following error and I am not sure why I am facing this issue.

ImportError: cannot import name 'PROTOCOL_TLS' from 'urllib3.util.ssl_' (*****/urllib3/util/ssl_.py)

I have verified version of boto3 and botocore and urlib3 i.e.
boto3 1.28.20
botocore 1.31.20
urllib3 1.26.16

pipdeptree --reverse | grep "requires: urllib3"
├── botocore==1.31.20 [requires: urllib3>=1.25.4,<1.27]
└── requests==2.31.0 [requires: urllib3>=1.21.1,<3]

I verified by going to ssl.py file I don't see any reference of 'PROTOCOL_TLS', can someone help me in resolving this issue and why I am seeing this.

Thanks

Expected Behavior

Should use the package already installed, the version of urllib3 is more than 1.24 so it should not have any problem also the latest urllib3 version is 2.0* but its not compatible with boto3

Current Behavior

its erroring out.

Reproduction Steps

upgraded boto3 botocore and urllib3

Possible Solution

No response

Additional Information/Context

No response

SDK version used

boto3 - 1.28.20

Environment details (OS name and version, etc.)

local env, boto3 -1.28.20 botocore - 1.31.20 urllib3 - 1.26.16

@kishorekumarhanbar kishorekumarhanbar added bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged. labels Aug 7, 2023
@kishorekumarhanbar kishorekumarhanbar changed the title (short issue description) ImportError: cannot import name 'PROTOCOL_TLS' from 'urllib3.util.ssl_' (*****/urllib3/util/ssl_.py) Aug 7, 2023
@tim-finnigan tim-finnigan self-assigned this Aug 8, 2023
@tim-finnigan
Copy link
Contributor

Hi @kishorekumarhanbar thanks for reaching out. The feature request for supporting urllib3 is being tracked here: boto/botocore#2926.

But the error you're reporting here has come up before, please refer to this comment for guidance: boto/botocore#2580 (comment)

PROTOCOL_TLS has been present in each release of urllib3 for the last ~3 years since 1.25.0. You can find the import workflow here. I'd double check the version of urllib3 you're using with botocore is actually 1.26.7. You can use urllib3.__version__ in your script to verify.

@tim-finnigan tim-finnigan added dependencies This issue is a problem in a dependency. response-requested Waiting on additional information or feedback. and removed bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged. labels Aug 8, 2023
@github-actions
Copy link

Greetings! It looks like this issue hasn’t been active in longer than five days. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-for-staleness dependencies This issue is a problem in a dependency. response-requested Waiting on additional information or feedback.
Projects
None yet
Development

No branches or pull requests

2 participants