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

pkg_resources.ContextualVersionConflict: (urllib3 1.25 (/usr/local/lib/python3.6/site-packages), Requirement.parse('urllib3<1.25,>=1.20; python_version >= "3.4"'), {'botocore'}) #4093

Closed
petersedivec opened this issue Apr 22, 2019 · 9 comments
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made.

Comments

@petersedivec
Copy link

This is very similar to issue #3535 closed in the fall. urllib released v1.25 this morning and so our python code leveraging boto3 is failing with the following stack trace. Assuming that this is something awscli needs to fix because it's failing on a requirements version check

Traceback (most recent call last): File "/usr/local/bin/pyrms_pipeit", line 6, in <module> from pkg_resources import load_entry_point File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3191, in <module> @_call_aside File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3175, in _call_aside f(*args, **kwargs) File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3204, in _initialize_master_working_set working_set = WorkingSet._build_master() File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 585, in _build_master return cls._build_from_requirements(__requires__) File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 598, in _build_from_requirements dists = ws.resolve(reqs, Environment()) File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 791, in resolve raise VersionConflict(dist, req).with_context(dependent_req) pkg_resources.ContextualVersionConflict: (urllib3 1.25 (/usr/local/lib/python3.6/site-packages), Requirement.parse('urllib3<1.25,>=1.20; python_version >= "3.4"'), {'botocore'})

@justnance justnance self-assigned this May 7, 2019
@justnance justnance added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label May 7, 2019
@justnance
Copy link

@petersedivec - Thanks for reporting this issue and referencing #3535. Please provide the command and steps used so I can try to reproduce the issue.

@rahulrajaram - what are your thoughts?

@petersedivec
Copy link
Author

@justnance - our app requires running multiple docker containers, the one that's failing above we haven't touched or updated in months so this was clearly a dependency driven issue. We can I'm sure lock urllib to v1.24 for the purpose of our code and that I believe will fix the error we're seeing so I mainly wanted to point this out to hopefully get this resolved. I'm not entirely sure why the requirement to limit the version number on urllib3 instead of just requiring that a minimum version is installed.

Here's what I can share with you of our code if you want to test something in python. Just try calling the list_all method with a given bucket once you've run aws configure.

import boto3
from botocore.exceptions import ClientError

  def list_all(bucket_name, filter_fun=None, s3_resource=None):
        s3_resource = s3_resource or get_resource()
        bucket = s3_resource.Bucket(name=bucket_name)
        docs = []
        for summary in bucket.objects.all():
            if not summary.key.endswith('/'):
                doc_data = S3DocData(bucket_name, summary.key, summary.size)
                if filter_fun and not filter_fun(doc_data):
                    continue
                docs.append(doc_data)
        return docs

Here's another related issue, what we're seeing with recent update to v1.25 of urllib3 seems like smoking gun
https://community.letsencrypt.org/t/contextualversionconflict-urllib3-1-23/63756

@justnance justnance removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label May 11, 2019
@samgreinert
Copy link

We're seeing this issue as well. Is there any update?

@petersedivec
Copy link
Author

@samgreinert - nothing from aws yet on a fix, we added one line to our dockerfile to pin the version of urllib3 to v1.24 so it's not an issue for us but would be nice for them to fix it, not just for v1.25 but for future releases so that when urllib3 releases a new version it doesn't break again

RUN pip install urllib3==1.24.3

@justnance justnance removed their assignment Aug 9, 2019
@kyleknap
Copy link
Contributor

kyleknap commented Sep 4, 2019

I believe this should be fixed now. Our current pin on Python 3.6 of urrlib3 is 1.26: https://github.com/boto/botocore/blob/23560bc7304e5dcf28ffebd09486ca80f853b1ff/setup.py#L50

@kyleknap kyleknap added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Sep 4, 2019
@no-response
Copy link

no-response bot commented Sep 11, 2019

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

@diggleweb
Copy link

tive o mesmo erro ao reproduzir rally para elasticsearch, aparentemente era um erro de compatibilidade que o revolvedor de problemas não conseguiu resolver

pip3 install urllib3 --use-feature=2020-resolver

Requirement already satisfied: urllib3 in ./src/lib/python3.8/site-packages (1.26.2)

supostamente foi resolvido, ao executar esrally, continuo tendo o mesmo problema erro acima relatado
logo teste instalar a versao manualmente

pip3 install urllib3==1.20
apos instalar a versao 1.20, e run ESRALLY ....
Requirement.parse('urllib3>=1.21.1'), {'elasticsearch'}) <- a versao que ele precisava é essa urllib3>=1.21.1'

** solução**

pip3 install urllib3==1.21.1
agora funcionou correctamente....

@crzypatchwork
Copy link

crzypatchwork commented Feb 6, 2021

when I install 1.21.1
pkg_resources.DistributionNotFound: The 'urllib3<1.26,>=1.25.4' distribution was not found and is required by awsebcli

when I install 1.25.4
pkg_resources.ContextualVersionConflict: (urllib3 1.25.4 (/home/crzy/.pyenv/versions/3.7.2/lib/python3.7/site-packages), Requirement.parse('urllib3<1.25,>=1.21.1'), {'requests'})

in the latest awsebcli

@kdaily
Copy link
Member

kdaily commented Feb 8, 2021

@crzypatchwork - we do not support the AWS Elastic Beanstalk CLI. The PyPI page has an author email for contacting:

https://pypi.org/project/awsebcli/

The repository is available here:

https://github.com/aws/aws-elastic-beanstalk-cli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made.
Projects
None yet
Development

No branches or pull requests

7 participants