pipenv 选项来模拟 pip -f 选项 [英] pipenv option to mimic pip -f option

查看:55
本文介绍了pipenv 选项来模拟 pip -f 选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 pip 中有一个 -f 选项,它执行以下操作:

In pip there is an -f option which does the following:

-f, --find-links :如果是 html 文件的 url 或路径,则解析存档链接.如果本地路径或 file:// url 是目录,则在目录列表中查找存档.

-f, --find-links : If a url or path to an html file, then parse for links to archives. If a local path or file:// url that's a directory, then look for archives in the directory listing.

这是安装 PyTorch 的首选方式,通过设置指向其概览网站的链接,例如:

This is the preferred way of installing PyTorch, by setting the link to their overview website, e.g.:

pip3 install torch===1.3.0 -f https://download.pytorch.org/whl/torch_stable.html

对于我的虚拟环境,我使用 pipenv 但我没有找到与 -f 相同的选项.同时,我可以查找与我的系统相关的软件包的直接链接,但这很麻烦.

For my virtual environments I use pipenv but I haven't found an option that does the same as -f. In the meantime, I can just look up the direct link to the package that is relevant for my system, but that is cumbersome.

pipenv 是否提供了一种与 pip 的 -f 相同的方法?

Does pipenv provide a way to do the same thing as pip's -f?

推荐答案

目前,我还没有找到解决方法.当然,您可以做的是启用 pipenv shell 并使用 pip 执行您必须执行的操作,例如

For now, I haven't found a work-around. What you can do, of course, is enabling the pipenv shell and doing what you must with pip, e.g.

pipenv shell
python -m pip install torch===1.3.0 -f https://download.pytorch.org/whl/torch_stable.html

这将在 pipenv 环境中安装火炬火炬不会添加到 Pipfile(也不会添加到锁定文件).

This will install torch in the pipenv environment but torch will not be added to the Pipfile (nor to the lock file).

这篇关于pipenv 选项来模拟 pip -f 选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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