Azure DevOps - pip ValueError: HTML doctype missing or incorrect

Azure DevOps - pip ValueError: HTML doctype missing or incorrect

我在 Azure DevOps 中创建了一个包源。在 pip 版本 22.0 发布之前一切正常。

现在,当我尝试使用 pip==22.0 从该提要安装包时

  File "c:\git_aures_aps\projects\venvs\aures_tools_test_p\lib\site-packages\pip\_internal\index\collector.py", line 427, in _raise_error
    "HTML doctype missing or incorrect. Expected <!DOCTYPE html>.\n\n"
ValueError: HTML doctype missing or incorrect. Expected <!DOCTYPE html>.

当我检查 https://pkgs.dev.azure.com/.../_packaging/.../pypi/simple/my-package/ 时,我发现该网站不是以 <!DOCTYPE HTML>

开头

如何编辑/重新创建带有 <!DOCTYPE HTML> 标签的 pypi/simple/my-package 存储库?

请查看错误信息的其余部分。

ValueError: HTML doctype missing or incorrect. Expected <!DOCTYPE html>.

If you believe this error to be incorrect, try passing the command line option --use-deprecated=html5lib and please leave a comment on the pip issue at https://github.com/pypa/pip/issues/10825.

它将带您到 https://github.com/pypa/pip/issues/10825,那里有相关的指导和信息。它还指出,您可以将 --use-deprecated=html5lib 传递给 pip,以使其暂时与此页面一起使用。

至于 Azure,您很可能需要联系 Azure 支持,因为他们需要在 IIUC 端修复此问题。

不幸的是,您无法自行更改,Microsoft 的 Azure DevOps 团队必须自行更改。 Developer Community 上有一个开放的请求,工程团队已经在研究它,所以请在此处跟进: https://developercommunity.visualstudio.com/t/azure-artifacts-pypi-feed-index-misses-html-doctyp/1667879

目前,您可以通过 --use-deprecated=html5lib 直到 pip 22.2(即 2022 年第三季度开始),届时此标志将被删除,如 pradyunsg 在 link 中所述。