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 download resolves wrong platform (bitness) on Windows #9962

Closed
1 task done
lefi7z opened this issue May 7, 2021 · 3 comments
Closed
1 task done

pip download resolves wrong platform (bitness) on Windows #9962

lefi7z opened this issue May 7, 2021 · 3 comments
Labels
resolution: duplicate Duplicate of an existing issue/PR

Comments

@lefi7z
Copy link

lefi7z commented May 7, 2021

Description

When downloading binary packages on Windows, pip seems to look for the wrong suffix: -win32 instead of the expected -amd64 (see below).

(test) C:\venv>python -VV
Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)]

(test) C:\venv>python -m pip list
Package    Version
---------- -------
pip        21.1.1
setuptools 41.2.0

(test) C:\venv>python -m pip download -d C:/Temp --only-binary :all: numpy
Collecting numpy
  Using cached numpy-1.20.2-cp38-cp38-win32.whl (11.4 MB)
Saved c:\temp\numpy-1.20.2-cp38-cp38-win32.whl
Successfully downloaded numpy

(test) C:\venv>

Expected behavior

No response

pip version

21.1.1

Python version

3.8.2

OS

Windows 64bit

How to Reproduce

python -m pip download -d C:/Temp --only-binary :all: numpy

Output

Collecting numpy
  Using cached numpy-1.20.2-cp38-cp38-win32.whl

Code of Conduct

@lefi7z lefi7z added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels May 7, 2021
@sbidoul
Copy link
Member

sbidoul commented May 9, 2021

This looks similar to #8649 ?

@lefi7z
Copy link
Author

lefi7z commented May 10, 2021

Yes, thank you! According to the mentioned issue, I checked the return value of distutils.utils.get_platform() and found that it gives the wrong result in a Developer Command Prompt:

$ python -c "import distutils.util; print(distutils.util.get_platform())"
win32

$ python -c "import distutils.util; print(distutils.util.get_host_platform())"
win-amd64

$ set VS
VS160COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\
VSCMD_ARG_app_plat=Desktop
VSCMD_ARG_HOST_ARCH=x86
VSCMD_ARG_TGT_ARCH=x86
VSCMD_VER=16.9.3
VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\

I would have never figured this out, believing that this information should be built into the binary at compile time! Well, using a vanilla Command Prompt does the trick.

@uranusjr
Copy link
Member

Closing as duplicate then.

@uranusjr uranusjr added resolution: duplicate Duplicate of an existing issue/PR and removed S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels May 12, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolution: duplicate Duplicate of an existing issue/PR
Projects
None yet
Development

No branches or pull requests

3 participants