简体   繁体   English

如果未提供软件包版本,则pip如何检测存档的URL?

[英]How does pip detect URL of archive if version of package is not provided?

When you run pip install somepackage , pip downloads the latest version of somepackage . 当您运行pip install somepackage ,PIP下载最新版本的somepackage

All archives on PYPI have names like somepackage-XXtar.gz . PYPI上的所有档案均具有somepackage-XXtar.gzsomepackage-XXtar.gz How does pip know what X s are? 点如何知道X是什么? Ie how does it detect the URL of the archive to download? 即,它如何检测要下载的档案的URL?

I believe PIP relies on the containing directory being readable/listable. 我相信PIP依赖于包含可读/可列出目录。 It then uses that directory listing to know all versions of the package, it's then easy to work out what the latest version is. 然后,它使用该目录列表来了解软件包的所有版本,然后很容易确定最新版本。

For example: https://pypi.python.org/packages/source/D/Django/ 例如: https : //pypi.python.org/packages/source/D/Django/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM