I am trying to download a whl file. The only problem is that there’s a version constraint on the install. And this constraint on the install, also constrains the download too. This question is how from the client side i can get around this constraint so i can download the whl file.
In this project there is a pyproject.toml file he has specified requires-python = ">=3.10"
constraint. I don’t have write access to this repository, however i can read it, and asking the person to change this parameter is impossible, as they are uncooperative.
Now, i want to download, but not install, the whl file onto my dev system with python 3.8 installed. Installing and making python 3.10 the default python on this system isn’t an option. How do i tell pip to ignore the version requirement so i can download the whl file, and without having to install a 3.10 virtual environment just to download the file each time.
If i download it directly i get this error:
...# pip download XXXX==0.2.18
Looking in indexes: ...
Collecting XXXX==0.2.18
Downloading .../XXXX.whl (50 kB)
|████████████████████████████████| 50 kB 2.0 MB/s
Saved ./XXXX.whl
ERROR: Package 'XXXX' requires a different Python: 3.8.10 not in '>=3.10'
The file that was downloaded is incomplete and not the whl package i need which should be ~500KB or so.
If i try and ignore the version number using the --ignores-requires-python
parameter it gives me an error, apparently this parameter is only available for pip install
but not pip download
, e.g:
...# pip download --ignore-requires-python XXXX==0.2.18
Usage:
pip download [options] <requirement specifier> [package-index-options] ...
pip download [options] -r <requirements file> [package-index-options] ...
pip download [options] <vcs project url> ...
pip download [options] <local project path> ...
pip download [options] <archive url/path> ...
no such option: --ignore-requires-python
Looking around further there’s an option for specifying the --python-version
, however it opens up a bunch of error messages:
...# pip download --python-version 3.10 XXXX==0.2.18
ERROR: When restricting platform and interpreter constraints using --python-version, --platform, --abi, or --implementation, either --no-deps must be set, or --only-binary=:all: must be set and --no-binary must not be set (or must be set to :none:).
I can’t find any meaningful information on how to use this option, presumably because the assumption is that people might try and install using it, and the download use case hasn’t been adequately considered by the python developers.
I have tried:
...# pip download --python-version 3.10 --no-deps XXXX==0.2.18
Looking in indexes: https://pypi.org/simple, ...
Collecting XXXX==0.2.18
File was already downloaded /.../XXXX.whl
Successfully downloaded XXXX
However this file is the incomplete file, of only 52KB size and is unusable. Similarly i have tried --only-binary=:all:
with no luck.
How can i download the whl file on a python 3.8 system? Is it possible?