Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Download wheel from PyPi

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.

like image 496
BoltzmannBrain Avatar asked Jul 15 '16 01:07

BoltzmannBrain


2 Answers

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 !

like image 103
Étienne Bersac Avatar answered Oct 20 '22 06:10

Étienne Bersac


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
like image 39
Darkdragon84 Avatar answered Oct 20 '22 06:10

Darkdragon84