为什么 pip search 找不到某些包,而这些包可以通过 pip install 安装?

4

为什么使用pip search搜索不到某些包(例如html5lib),但是它们仍然可以通过pip install安装?

E:\software\Python276\Scripts>pip search html5lib
html5lib-truncation       - Truncating HTML with html5lib filter
HTML-Sanitizer-With-IFrame - Extends Python html5lib's sanitizer.HTMLSanitizer
                            to allow iframe elements.
microdata                 - html5lib extension for parsing microdata
html5tidy                 - Simple wrapper around html5lib & lxml.etree to
                            "tidy" html in the wild to well-formed xml/html

E:\software\Python276\Scripts>pip install html5lib
Downloading/unpacking html5lib
  Running setup.py (path:c:\users\user\appdata\local\temp\pip_build_user\html5lib\setup.py) egg_info for package html5lib

Requirement already satisfied (use --upgrade to upgrade): six in e:\software\python276\lib\site-packages (from html5lib)
Installing collected packages: html5lib
  Running setup.py install for html5lib

Successfully installed html5lib
Cleaning up...

在 https://pypi.python.org/pypi 搜索时也没有显示出来。 - Chuck
@Chuck Logan Lim 为什么可以通过 pip install 安装呢? - FrozenHeart
1个回答

4

html5lib在pypi.python.org上是隐藏的, 所以它不会出现在搜索结果中,但仍然可以直接访问:

    "_pypi_hidden": true, 

我不确定为什么该软件包被隐藏(它只是数据库字段中的一个标志),但我强烈怀疑这是由于软件包的奇怪版本控制系统(最近的版本在前):
  • 0.9999999/1.0b8
  • 0.999999/1.0b7
  • [...]
  • 0.99 没有从1.0b3进行库更改;发布为0.99,因为pip已根据PEP 440更改了行为,以避免安装预发行版本。
  • 1.0b3
  • [...]
解决方法是发布一个适当的1.0版本,这将显示在beta版本之上,并希望重置隐藏标志。

啊,我完全没有意识到隐藏一些旧版本会导致这种情况。:\ - gsnedders

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接