从 PyPi 下载轮子 [英] Download wheel from PyPi

查看:64
本文介绍了从 PyPi 下载轮子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从 PyPi 上列出的软件包中下载特定的轮子?我假设我会使用 wgetcurl,但我不确定要使用哪些参数.

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.

推荐答案

众所周知,PyPI 很难自省.幸运的是,Debian 项目用于扫描新版本的 FTP 目录,并设置解决方案来解决此问题.它记录在 https://wiki.debian.org/debian/watch#PyPI

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

例如,如果您访问 https://pypi.debian.net/pip/,你将有很长的发布列表.如您所愿,您可以使用 curl 直接下载 tarball,而无需知道其校验和:

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

请注意,即使未列出,您也可以下载该轮子.但您可能需要构建 URL.

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 !

这篇关于从 PyPi 下载轮子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆