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

When using --use-feature=2020-resolver - Pip fails installing some packages from site-packages in virtualenv #9035

Closed
favipcj opened this issue Oct 22, 2020 · 9 comments
Labels
project: <downstream> When the cause/effect is related to redistributors

Comments

@favipcj
Copy link

favipcj commented Oct 22, 2020

Hi, I tried looking for a similar issue but I couldn't find anything, although this issue is related with #8731

Environment

pip version: 20.2.4
Python version:3.7
OS: any
Dockerfile that illustrates this issue:

FROM python:3.7
RUN pip install virtualenv requests argparse==1.4.0
RUN /usr/local/bin/virtualenv --system-site-packages tst
RUN /tst/bin/pip3.7 install --upgrade pip==20.2.4 && /tst/bin/pip3.7 install  --use-feature=2020-resolver --proxy 127.0.0.1 --retries 0 --timeout 1 argparse==1.4.0

Description
When trying to install some packages like argparse the installation is failing if there is no connection to a remote repo that contains that package.

Using the same example from #8731, the issue seems to be happening only with some packages like argparse and not with requests for example.

Expected behavior
Pip installs argparse correctly in the virtualenv in the above example.

Output

ERROR: Could not find a version that satisfies the requirement argparse==1.4.0
ERROR: No matching distribution found for argparse==1.4.0
@uranusjr
Copy link
Member

uranusjr commented Oct 22, 2020

We’re ignoring three packages, argparse, wsgiref, and python, because they have the same names with stdlib modules and cause problems if you try to upgrading them. It should be possible to fix this, but… why do you want to install them in the first place?

@favipcj
Copy link
Author

favipcj commented Oct 22, 2020

For getting all the libraries versions pinned in our libraries we compile our requirements using pip-tools, so argparse get's added as part of those requirements.
The issue that we are seeing is that when we have a library A with that requirement(argparse) a library B that depends from A, cannot get installed because argparse is not able to be installed for the error described before.

For example using the library dateutils you get argparse as part of your requirements

@pfmoore
Copy link
Member

pfmoore commented Oct 22, 2020

dateutils should really only depend on argparse for very old Python versions, so the bug is probably with them.

@uranusjr
Copy link
Member

I opened jmcantrell/python-dateutils#10 for this.

@pradyunsg
Copy link
Member

@pfmoore @uranusjr I think it's OK to call this a downstream issue. If you think so too, I think @uranusjr's PR covers this TBH.

@pfmoore pfmoore added the project: <downstream> When the cause/effect is related to redistributors label Oct 22, 2020
@favipcj
Copy link
Author

favipcj commented Oct 23, 2020

thanks guys, just to clarify; this scenario can happen only with libraries that have argparse or wsgiref as dependency in their requirements right ?

@uranusjr
Copy link
Member

uranusjr commented Oct 23, 2020

@favipcj Correct. Technically there’s another package name Python, but that package name is not available on PyPI (I believe it’s squatted by the PSF) and more obviously problematic.

@favipcj
Copy link
Author

favipcj commented Oct 23, 2020

understood, thanks!

@pradyunsg
Copy link
Member

Closing this seems to be resolved. :)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
project: <downstream> When the cause/effect is related to redistributors
Projects
None yet
Development

No branches or pull requests

4 participants