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

pip -d tries (and fails) to download packages meant for wrong platform #11418

Closed
1 task done
Michael-Kuritzky opened this issue Aug 28, 2022 · 1 comment
Closed
1 task done
Labels
type: bug A confirmed bug or unintended behavior

Comments

@Michael-Kuritzky
Copy link

Description

Hi,

I have a build system which uses pip -d to download packages along with their dependencies. Recently I ran into an error when I tried to update one of the packages I use (details below), which seems to stem from pip -d trying to grab unnecessary dependencies (meant for a different platform).

Some details:
I'm using Windows, and running pip -d --platform manylinux1_x86_64 to download packages meant for Linux.
I ran into the problem when I tried to switch from azure-identity==1.3.1 to azure-identity==1.10.0.
azure-identity==1.10.0 depends, among other things, on msal-extensions<2.0.0,>=0.3.0 which, in turn, depends on portalocker<3,>=1.6 for Windows-based platforms and portalocker<3,>=1.0 for non-Windows-based platforms.
So far, so good.
However, all the versions of portalocker from 1.6.0 seem to have a Windows-specific dependency on a Windows-specific package named pywin32 (pywin32>=226; platform_system == "Windows"). That in itself should not be a problem, but pip -d seems to ignore the "windows-specificness" of this dependency and tries to download it - an operation which fails since there are, naturally, no versions of pywin32 meant for Linux.

Expected behavior

I expect pip -d --platform manylinux1_x86_64 to ignore Windows-specific dependencies.

pip version

22.2.2

Python version

3.7.9

OS

Microsoft Windows 11 Enterprise Version 10.0.22000 Build 22000

How to Reproduce

  1. Install Python on a Windows machine (I have Python 3.7.9, but I doubt it matters in this case).
  2. Update pip to 22.2.2.
  3. Run the following command: py -m pip download azure-identity==1.10.0 -d "C:\Temp\PipRepro" --platform "manylinux1_x86_64" --python-version "3.8" --only-binary=:all: --retries 3 --timeout 60
    (you can substitute some other directory instead of "C:\Temp\PipRepro", of course.
  4. pip complains that it "Cannot install msal-extensions because these package versions have conflicting dependencies.".

Output

Collecting azure-identity==1.10.0
  Using cached azure_identity-1.10.0-py3-none-any.whl (134 kB)
Collecting six>=1.12.0
  File was already downloaded c:\temp\piprepro\six-1.16.0-py2.py3-none-any.whl
Collecting cryptography>=2.5
  File was already downloaded c:\temp\piprepro\cryptography-3.3.2-cp36-abi3-manylinux1_x86_64.whl
Collecting azure-core<2.0.0,>=1.11.0
  File was already downloaded c:\temp\piprepro\azure_core-1.25.0-py3-none-any.whl
Collecting msal<2.0.0,>=1.12.0
  File was already downloaded c:\temp\piprepro\msal-1.18.0-py2.py3-none-any.whl
Collecting msal-extensions<2.0.0,>=0.3.0
  Using cached msal_extensions-1.0.0-py2.py3-none-any.whl (19 kB)
Collecting requests>=2.18.4
  File was already downloaded c:\temp\piprepro\requests-2.28.1-py3-none-any.whl
Collecting typing-extensions>=4.0.1
  File was already downloaded c:\temp\piprepro\typing_extensions-4.3.0-py3-none-any.whl
Collecting cffi>=1.12
  File was already downloaded c:\temp\piprepro\cffi-1.14.6-cp38-cp38-manylinux1_x86_64.whl
Collecting PyJWT[crypto]<3,>=1.0.0
  File was already downloaded c:\temp\piprepro\PyJWT-2.4.0-py3-none-any.whl
Collecting portalocker<3,>=1.6
  Using cached portalocker-2.5.1-py2.py3-none-any.whl (15 kB)
Collecting pycparser
  File was already downloaded c:\temp\piprepro\pycparser-2.21-py2.py3-none-any.whl
Collecting portalocker<3,>=1.6
  Using cached portalocker-2.5.0-py2.py3-none-any.whl (15 kB)
  Using cached portalocker-2.4.0-py2.py3-none-any.whl (16 kB)
  Using cached portalocker-2.3.2-py2.py3-none-any.whl (15 kB)
  Using cached portalocker-2.3.1-py2.py3-none-any.whl (15 kB)
  Using cached portalocker-2.3.0-py2.py3-none-any.whl (15 kB)
  Using cached portalocker-2.2.1-py2.py3-none-any.whl (15 kB)
  Using cached portalocker-2.2.0-py2.py3-none-any.whl (15 kB)
  Using cached portalocker-2.1.0-py2.py3-none-any.whl (13 kB)
  Using cached portalocker-2.0.0-py2.py3-none-any.whl (11 kB)
  Using cached portalocker-1.7.1-py2.py3-none-any.whl (10 kB)
  Using cached portalocker-1.7.0-py2.py3-none-any.whl (14 kB)
  Using cached portalocker-1.6.0-py2.py3-none-any.whl (14 kB)
INFO: pip is looking at multiple versions of cffi to determine which version is compatible with other requirements. This could take a while.
Collecting cffi>=1.12
  Using cached cffi-1.14.5-cp38-cp38-manylinux1_x86_64.whl (411 kB)
INFO: pip is looking at multiple versions of six to determine which version is compatible with other requirements. This could take a while.
Collecting six>=1.12.0
  Using cached six-1.15.0-py2.py3-none-any.whl (10 kB)
INFO: pip is looking at multiple versions of msal-extensions to determine which version is compatible with other requirements. This could take a while.
Collecting msal-extensions<2.0.0,>=0.3.0
  Using cached msal_extensions-0.3.1-py2.py3-none-any.whl (18 kB)
  Using cached msal_extensions-0.3.0-py2.py3-none-any.whl (16 kB)
INFO: pip is looking at multiple versions of msal to determine which version is compatible with other requirements. This could take a while.
Collecting msal<2.0.0,>=1.12.0
  Using cached msal-1.17.0-py2.py3-none-any.whl (79 kB)
  Using cached msal-1.16.0-py2.py3-none-any.whl (78 kB)
INFO: pip is looking at multiple versions of msal-extensions to determine which version is compatible with other requirements. This could take a while.
  Using cached msal-1.15.0-py2.py3-none-any.whl (77 kB)
  Using cached msal-1.14.0-py2.py3-none-any.whl (75 kB)
INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. See https://pip.pypa.io/warnings/backtracking for guidance. If you want to abort this run, press Ctrl + C.
  Using cached msal-1.13.0-py2.py3-none-any.whl (67 kB)
  Using cached msal-1.12.0-py2.py3-none-any.whl (66 kB)
INFO: pip is looking at multiple versions of cryptography to determine which version is compatible with other requirements. This could take a while.
Collecting cryptography>=2.5
  Using cached cryptography-3.3.1-cp36-abi3-manylinux1_x86_64.whl (2.7 MB)
INFO: pip is looking at multiple versions of msal to determine which version is compatible with other requirements. This could take a while.
INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. See https://pip.pypa.io/warnings/backtracking for guidance. If you want to abort this run, press Ctrl + C.
  Using cached cryptography-3.3-cp36-abi3-manylinux1_x86_64.whl (2.7 MB)
  Using cached cryptography-3.2.1-cp35-abi3-manylinux1_x86_64.whl (2.6 MB)
  Using cached cryptography-3.2-cp35-abi3-manylinux1_x86_64.whl (2.6 MB)
  Using cached cryptography-3.1.1-cp35-abi3-manylinux1_x86_64.whl (2.6 MB)
  Using cached cryptography-3.1-cp35-abi3-manylinux1_x86_64.whl (2.6 MB)
  Using cached cryptography-3.0-cp35-abi3-manylinux1_x86_64.whl (2.7 MB)
INFO: pip is looking at multiple versions of cryptography to determine which version is compatible with other requirements. This could take a while.
  Using cached cryptography-2.9.2-cp35-abi3-manylinux1_x86_64.whl (2.7 MB)
  Using cached cryptography-2.9.1-cp35-abi3-manylinux1_x86_64.whl (2.7 MB)
  Using cached cryptography-2.9-cp35-abi3-manylinux1_x86_64.whl (2.7 MB)
  Using cached cryptography-2.8-cp34-abi3-manylinux1_x86_64.whl (2.3 MB)
  Using cached cryptography-2.7-cp34-abi3-manylinux1_x86_64.whl (2.3 MB)
Collecting asn1crypto>=0.21.0
  Using cached asn1crypto-1.5.1-py2.py3-none-any.whl (105 kB)
INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. See https://pip.pypa.io/warnings/backtracking for guidance. If you want to abort this run, press Ctrl + C.
Collecting cryptography>=2.5
  Using cached cryptography-2.6.1-cp34-abi3-manylinux1_x86_64.whl (2.3 MB)
  Using cached cryptography-2.5-cp34-abi3-manylinux1_x86_64.whl (2.4 MB)
INFO: pip is looking at multiple versions of azure-core to determine which version is compatible with other requirements. This could take a while.
Collecting azure-core<2.0.0,>=1.11.0
  Using cached azure_core-1.24.2-py3-none-any.whl (178 kB)
  Using cached azure_core-1.24.1-py3-none-any.whl (178 kB)
  Using cached azure_core-1.24.0-py3-none-any.whl (178 kB)
  Using cached azure_core-1.23.1-py3-none-any.whl (178 kB)
  Using cached azure_core-1.23.0-py3-none-any.whl (179 kB)
  Using cached azure_core-1.22.1-py3-none-any.whl (178 kB)
  Using cached azure_core-1.21.1-py2.py3-none-any.whl (178 kB)
INFO: pip is looking at multiple versions of azure-core to determine which version is compatible with other requirements. This could take a while.
  Using cached azure_core-1.21.0-py2.py3-none-any.whl (178 kB)
  Using cached azure_core-1.20.1-py2.py3-none-any.whl (177 kB)
  Using cached azure_core-1.20.0-py2.py3-none-any.whl (176 kB)
  Using cached azure_core-1.19.1-py2.py3-none-any.whl (176 kB)
  Using cached azure_core-1.19.0-py2.py3-none-any.whl (176 kB)
INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. See https://pip.pypa.io/warnings/backtracking for guidance. If you want to abort this run, press Ctrl + C.
  Using cached azure_core-1.18.0-py2.py3-none-any.whl (166 kB)
  Using cached azure_core-1.17.0-py2.py3-none-any.whl (165 kB)
  Using cached azure_core-1.16.0-py2.py3-none-any.whl (163 kB)
  Using cached azure_core-1.15.0-py2.py3-none-any.whl (138 kB)
  Using cached azure_core-1.14.0-py2.py3-none-any.whl (136 kB)
  Using cached azure_core-1.13.0-py2.py3-none-any.whl (133 kB)
  Using cached azure_core-1.12.0-py2.py3-none-any.whl (130 kB)
  Using cached azure_core-1.11.0-py2.py3-none-any.whl (127 kB)
INFO: pip is looking at multiple versions of <Python from Requires-Python> to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of azure-identity to determine which version is compatible with other requirements. This could take a while.
ERROR: Cannot install msal-extensions because these package versions have conflicting dependencies.

The conflict is caused by:
    portalocker 1.7.1 depends on pywin32!=226; platform_system == "Windows"
    portalocker 1.7.0 depends on pywin32!=226; platform_system == "Windows"
    portalocker 1.6.0 depends on pywin32!=226; platform_system == "Windows"

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

Code of Conduct

@Michael-Kuritzky Michael-Kuritzky added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Aug 28, 2022
@sbidoul
Copy link
Member

sbidoul commented Aug 28, 2022

This looks like a duplicate of #10050.

@sbidoul sbidoul closed this as completed Aug 28, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 29, 2022
@pradyunsg pradyunsg removed the S: needs triage Issues/PRs that need to be triaged label Nov 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants