How can I download a specific wheel from a package listed on PyPi? I'm assuming I would use wget
or curl
, but I'm not sure of which arguments to use.
Asked
Active
Viewed 5,255 times
12

BoltzmannBrain
- 5,082
- 11
- 46
- 79
2 Answers
10
PyPI is known to be hard to introspect. Fortunately, the Debian project is used to scan FTP directories for new versions, and set up a solution to workaround this. It is documented at https://wiki.debian.org/debian/watch#PyPI
For exemple, if you access https://pypi.debian.net/pip/, you will have in long list of release. And as you wish, you can directly download a tarball without knowing its checksum, using curl:
$ curl -LO https://pypi.debian.net/pip/pip-18.1.tar.gz
Note that, even if it's not listed, you can download the wheel. But you may need to construct the URL.
$ curl -LO https://pypi.debian.net/pip/pip-18.1-py2.py3-none-any.whl
If you find some tricks around this solution, feel free to share it !

Étienne Bersac
- 580
- 6
- 11
-
1check out this answer https://stackoverflow.com/a/48327216/2641187 – Darkdragon84 Aug 15 '21 at 09:14
-
Worked for my example: `wget https://pypi.debian.net/selenium/selenium-4.5.0-py3-none-any.whl`, thanks! – Apteryx Oct 15 '22 at 21:10
8
Update 2021: PyPI package pages have a section #files
where you can conveniently download the .whl you'd like
https://pypi.org/project/<package-name>/#files

Darkdragon84
- 539
- 5
- 13
-
But there's no direct way to access the .whl link, right? In other words, I must scrape the .whl URL from the page link you provided above, correct? – Apteryx Oct 15 '22 at 21:08
-
I guess not, as there is no rule how you supply your package, i.e. as whl, egg or just setup code. So you need to check what is actually available for your distro and python version. Ther IS a standard naming convention though https://peps.python.org/pep-0423/ – Darkdragon84 Oct 16 '22 at 17:03