What are the valid values for –platform, –abi, and –implementation for pip download?

Question:

pip download has several flags that I would like to play with --platform, --abi, and --implementation.

Where can I find the complete list of valid values for these flags?

Asked By: ericg

||

Answers:

I don’t think there is one definitive list. You have to collect it from different sources. Start with PEP 425: https://www.python.org/dev/peps/pep-0425/

python tag: ‘py27’, ‘cp33’

abi tag: ‘cp32dmu’, ‘none’

platform tag: ‘linux_x86_64’, ‘any’

--implementation:

cp: CPython
ip: IronPython
pp: PyPy
jy: Jython

--platform:

win32
linux_i386
linux_x86_64
Answered By: phd

If you have access to the PC (or similar platform) for which you need to download the package, per the documentation, the following function can be called to get the explicit platform name.

distutils.util.get_platform()

The platform tag is simply distutils.util.get_platform() with all hyphens – and periods . replaced with underscore _.


In our case, we have offline PCs (which must remain offline); so this approach works perfectly to ensure we download the correct platform for those PCs.

Answered By: S3DEV

If you are only downloading a single package, you could go to https://pypi.org and search for what’s available.

E.g. for orjson https://pypi.org/project/orjson/3.8.2/#files, you can see there’s things like:

  • win_amd64
  • manylinux_2_28_x86_64
  • manylinux_2_28_aarch64
  • manylinux_2_17_x86_64
  • manylinux2014_x86_64
  • manylinux_2_17_armv7l
  • manylinux2014_armv7l
  • manylinux_2_17_aarch64
  • manylinux2014_aarch64
  • macosx_10_9_x86_64
  • macosx_11_0_arm64
  • macosx_10_9_universal2
  • macosx_10_7_x86_64

If you’re curious what manylinux means, refer to this: https://github.com/pypa/manylinux

The manylinux_x_y refers to glibc versions, observed when you run ldd --version in your shell. glibc is backwards compatible, so pick a version equal to or below your current glibc version.

Answered By: Cardin
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.