-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Cannot create virtualenv on python3.5 when installed with old pip versions #2001
Comments
Given that importlib-resources==3.3.0 correctly declares Requires-Python (https://pypi.org/pypi/importlib-resources/3.3.0/json), I'm a bit surprised that your Python 3.5 environment has importlib-resources 3.3.0. None the less, pip 20.3 will fix this issue (by fixing pypa/pip#988) which would correctly detect "oh, I made a bad choice" and prevent populating the environment incorrectly. |
Not sure what we can do here. Seems this is a bug in your installer, not in our own logic. How did you install virtualenv (exactly)? |
Good points about pip. My problem can also be summarized as a pip problem; or rather, using an old pip. One which, it seems, does not properly recognize all dependency directives ("don't use 3.3.0 for py35"). This can be replicated easily with the base ubuntu 16.04 image:
Once inside:
You will notice above that 3.3.0 is installed, and causes By upgrading pip prior to any
(note that for my case, I will specifically add There are several things interacting here, but the bottom line from my perspective is this: A set of bootstrapping instructions, which in my mind ought to produce identical (or at least functional) images, became invalid today because of a combination of things. Perhaps it's best practice to always upgrade pip prior to use. While I am hesitant to have all docker images upgrade to the latest pip as part of initial setup, I also understand that asking the python dev community to support all ancient forms of package-installers forever is a silly notion. I'm happy that there is a better fix than pinning versions manually, and mostly wanted to share in case people ran into the same. I will update the title to reflect these learnings; please feel free to close the issue. |
Issue
virtualenv
(or at least, a fresh install thereof) is broken for python3.5 due to the combination of:importlib-resources
, which will simply pull the latest availableI've verified that pinning
importlib-resources<3.3.0
is a viable workaround for this issue. This could be incorporated into virtualenv's setup, or done manually by users wherever necessary. Python 3.5 is end-of-life, and Ubuntu 16.04's end-of-life is fast approaching, so maybe this is not an issue worth fixing. But with such an easy workaround, and since other folks may run into the same, thought I would mention it here.I only stumbled across this because an open source lib we maintain uses docker + tox testing, and as it hasn't seen much dev over the years, so it still uses ubuntu 16.04 for a base image. I was surprised to see that the same environment setup is no longer functional. By pinning the version as mentioned above, things are functional again.
UPDATE: a better fix is to upgrade pip, which will detect that importlib-resources-3.3.0 does not support py35, via:
Environment
Output of the virtual environment creation
The text was updated successfully, but these errors were encountered: