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
Setuptools v45.0.0 breaks virtualenv on Python 2 #1493
Comments
I confirm this is a major issue. In OpenStack most gates are broken atm due to this. See: http://lists.openstack.org/pipermail/openstack-discuss/2020-January/011956.html Thanks for reporting, /me late by half an hour - I thought virtualenv would use the pip's modern resolver but it seemingly does not. |
Already tracked in setuptools for another downstream pypa/setuptools#1963 |
Not sure why setuptools 45+ gets picked up, virtualenvs bootstrap should keep it 44 for setuptools. 🤔 |
Here is the traceback: http://paste.openstack.org/show/788301/ legacy_resolve sounds like something that would discard the new rules. |
Nah, wrong avenue to explore, raw pip also ignores py version constraint (despite being advertised as working): http://paste.openstack.org/show/788302/ |
I'll have a look and release a fix tomorrow. If anyone has time to make a pr before that would help. |
@yoctozepto can't seem to replicate your failure; can you give us the full creation log with triple verbosity? |
@gaborbernat If it's the same issue as pypa/pip#7586, then this may be a bug in one of the PyPA mirrors @yoctozepto is using. Apparently one of them is not propagating the |
If so, then this is a bug for that mirror; nothing to do with ourselves 🤷♂ |
This should be a temporary fix for broken setuptools/virtualenv: pypa/virtualenv#1493 Buddy: Vittorio
The following worked for me getting out of this issue. pip install --upgrade 'setuptools<45.0.0' |
I am working with a project that is still using python 2.7 :(, and I had the same problem. |
However this is still critical when creating a new virtual environment for python 2.7, since |
This should only happen if you're behind an index server that does not propogate python-requires... so I'd recommend fixing the index server. |
@gaborbernat not that I am aware of. Is there a way for me to check it? I can see that pythonhosted.org is used when downloading the packages when creating the virtualenv:
|
Pass in the -v flags for |
That works and the correct version is installed:
The problem arises only when creating the virtual environment. |
@ostefano It was the same for me. I worked around this by installing
|
pip install setuptools picks up setuptools>=45.0.0 even though these versions don't support Python 2 (see discussion on pypa/virtualenv#1493) That's why setuptools was downgraded with pip install --upgrade 'setuptools<45.0.0'
see also pypa/virtualenv#1493 Signed-off-by: Kefu Chai <kchai@redhat.com>
see also pypa/virtualenv#1493 Signed-off-by: Kefu Chai <kchai@redhat.com>
see also pypa/virtualenv#1493 Signed-off-by: Kefu Chai <kchai@redhat.com>
We faced the same issue: mozilla-services/syncserver#239 So I am a bid puzzled where/on which level the bug needs to be searched, Python, virtualenv, pip, pythonhosted.org or is there something in the middle? |
Foreword: I am quite familiar with the whole January 1st, 2020 deadline and am in the process of dropping Python 2 across all my projects, but this surprise from setuptools is quite inconvenient regardless. If you chose not to fix this, I will not judge anyone, but please don't lecture me about Python 2 being deprecated :-)
All my automated virtual environment creation scripts on Python 2 started breaking today.
Here is an example:
This seems to be caused by the release of
setuptools
v45.0.0 yesterday:It seems that, by default,
virtualenv
tries to install the latest setuptools and thatpip install setuptools
picks upsetuptools>=45.0.0
even though these versions don't support Python 2.As a workaround, I am now using the following commands:
I'm no export in Python packaging, but I would expect
setuptools>=45
to declare it doesn't support Python 2 in its distribution metadata and thatpip install setuptools
would automatically detect that and avoid it, but this doesn't seem to be the case.If that is not possible, maybe versions of
virtualenv
for Python 2 should avoidsetuptools>=45
?The text was updated successfully, but these errors were encountered: