2

I recently needed to download Python packages on a macOS machine with Python 3.7 to deploy later on a Linux machine with Python 3.7.

I therefore executed the following command to download the needed packages:

pip3 download --platform manylinux1_x86_64 --python-version 3.7 --abi cp37m --only-binary :all: <package>

However, some of the packages were not obtainable using the above command. After some experimenting, I could download them using --abi cp37 instead of --abi cp37m.

How can I check which versions (platform,version,abi) of a package are available using pip3?

Shuzheng
  • 11,288
  • 20
  • 88
  • 186
  • Does this help? https://stackoverflow.com/questions/4888027/python-and-pip-list-all-versions-of-a-package-thats-available – Brenden Price May 25 '20 at 17:58
  • 1
    Does this answer your question? [Python and pip, list all versions of a package that's available?](https://stackoverflow.com/questions/4888027/python-and-pip-list-all-versions-of-a-package-thats-available) – AndrewL64 May 25 '20 at 18:01
  • @AndrewL64 - it says nothing about which platforms and ABIs are available, only different package versions. – Shuzheng May 25 '20 at 18:06

1 Answers1

1

I managed to limit the list of versions returned by pip install package== using --platform= and other options. For example, tensorflow with platform tag manylinux1_x86_64:

$ pip install --platform=manylinux1_x86_64 --no-deps -t /tmp tensorflow==
Collecting tensorflow==

ERROR: Could not find a version that satisfies the requirement tensorflow== (from versions: 0.12.0rc0, 0.12.0rc1, 0.12.0, 0.12.1, 1.0.0, 1.0.1, 1.1.0rc0, 1.1.0rc1, 1.1.0rc2, 1.1.0, 1.2.0rc0, 1.2.0rc1, 1.2.0rc2, 1.2.0, 1.2.1, 1.3.0rc0, 1.3.0rc1, 1.3.0rc2, 1.3.0, 1.4.0rc0, 1.4.0rc1, 1.4.0, 1.4.1, 1.5.0rc0, 1.5.0rc1, 1.5.0, 1.5.1, 1.6.0rc0, 1.6.0rc1, 1.6.0, 1.7.0rc0, 1.7.0rc1, 1.7.0, 1.7.1, 1.8.0rc0, 1.8.0rc1, 1.8.0, 1.9.0rc0, 1.9.0rc1, 1.9.0rc2, 1.9.0, 1.10.0rc0, 1.10.0rc1, 1.10.0, 1.10.1, 1.11.0rc0, 1.11.0rc1, 1.11.0rc2, 1.11.0, 1.12.0rc0, 1.12.0rc1, 1.12.0rc2, 1.12.0, 1.12.2, 1.12.3, 1.13.0rc0, 1.13.0rc1, 1.13.0rc2, 1.13.1, 1.13.2, 1.14.0rc0, 1.14.0rc1, 1.14.0, 2.0.0a0, 2.0.0b0, 2.0.0b1)

The last version returned is 2.0.0b1. Let's verify it at PyPI: version 2.0.0b1 has releases with that tag, later versions switched to manylinux2010_x86_64 and are not listed with the command above.

phd
  • 82,685
  • 13
  • 120
  • 165
  • Thank you. So there is no way to see tags such as platform and ABI? When using the `--only-binary` option of `pip3`, the `--platform` and `--abi` options must be specified. I cannot just rely on “wild” guesses for those? In my example, I use `--platform manylinux1_x86_x64`, which I found in some docs and is different from yours. – Shuzheng May 26 '20 at 04:23
  • Ohh, I see the platform tags as part of the filenames only on PyPI? No command line way of retrieving those tags? – Shuzheng May 26 '20 at 04:28
  • I find it problematic, that `pip3 download --platform manylinux1_x86_64 --python-version 3.7 --abi cp37 --no-deps tensorflow==` results in `ERROR: No matching distribution found for tensorflow==` without any suggestions on which versions are available. I've to experiment with e.g. different ABIs to see that `pip3 download --platform manylinux1_x86_64 --python-version 3.7 --abi cp37m --no-deps tensorflow==` return results. It's this "brute-force" approach I'd like to avoid. – Shuzheng May 26 '20 at 07:12
  • @Shuzheng I'm afraid that's the best you can get. I don't know any way to list compatible releases from the command line. For everything more you have to go to PyPI and lookup versions and releases manually. :-( – phd May 26 '20 at 12:54