-e, --editable 选项何时对 pip install 有用? [英] When would the -e, --editable option be useful with pip install?

查看:144
本文介绍了-e, --editable 选项何时对 pip install 有用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

-e--editable 选项何时对 pip install 有用?

When would the -e, or --editable option be useful with pip install?

对于某些项目,requirements.txt 中的最后一行是 -e ..它究竟是做什么的?

For some projects the last line in requirements.txt is -e .. What does it do exactly?

推荐答案

正如手册页所说:

-e,--editable <path/url>
     Install a project in editable mode (i.e.  setuptools "develop mode") from a local project path or a VCS url.

因此,当您尝试在本地安装软件包时会使用它,最常见的情况是在您的系统上开发它时.它只会将包链接到原始位置,基本上意味着对原始包的任何更改都会直接反映在您的环境中.

So you would use this when trying to install a package locally, most often in the case when you are developing it on your system. It will just link the package to the original location, basically meaning any changes to the original package would reflect directly in your environment.

关于相同的一些细节这里此处.

Some nuggets around the same here and here.

示例运行可以是:

pip install -e .

pip install -e ~/ultimate-utils/ultimate-utils-proj-src/

注意第二个是 setup.py 所在位置的完整路径.

note the second is the full path to where the setup.py would be at.

这篇关于-e, --editable 选项何时对 pip install 有用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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