gpt4 book ai didi

python - 我怎样才能让 pip 列出它正在使用的存储库?

转载 作者:太空狗 更新时间:2023-10-29 21:44:59 24 4
gpt4 key购买 nike

我试图让一个代码库在我的机器上运行,但 pip 没有找到一些依赖项。好像是在另一台机器上找到的,所以我想看看两台机器上使用的是哪个repos pip,这样我就可以进行比较。

我该怎么做?

最佳答案

21.1.2 更新

(从@Bryan Roach 的评论中复制):

pip download --no-cache-dir --verbose "foo<0" 2>&1 |grep 'location(s) to search' -A5

更新 pip>=20

现在默认列出存储库,无需传递 --verbose arg:

$ pip download --no-cache-dir "foo<0" 2>&1 | grep Looking
Looking in indexes: https://pypi.org/simple, https://my-index.local, http://127.0.0.1:9000

原始答案

当使用 --verbose 标志时,显示 pip 搜索包的存储库:pip install --verbose ...pip 下载 --verbose ...。指定一些不存在的要求,这样 pip 实际上不会下载/安装任何东西。示例:

$ pip download --no-cache-dir --verbose "foo<0" 2>&1 | grep Looking
Looking in indexes: https://pypi.org/simple, https://my-index.local, http://127.0.0.1:9000

关于python - 我怎样才能让 pip 列出它正在使用的存储库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51874974/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com