如何使用pip ansible命令执行« ./bin/pip install -e . »?

2 投票
1 回答
795 浏览
提问于 2025-04-18 08:25

我该怎么执行:

./bin/pip install -e .

使用 pip 和 ansible 命令时,我在文档示例中没有看到这种情况:http://docs.ansible.com/pip_module.html

1 个回答

2

你可以使用pip模块的extra_args参数来指定你想要传递的其他参数。不过,大多数情况下其实不需要特别加上-e这个选项。根据Ansible的文档:

# Install (MyApp) using one of the remote protocols (bzr+,hg+,git+,svn+). 
# You do not have to supply '-e' option in extra_args.
- pip: name='svn+http://myrepo/svn/MyApp#egg=MyApp'

所以如果你是从远程仓库安装,只需要把库的名字设置为要安装的库的完整网址。如果你想在本地安装一个库,只需指定源目录的完整路径即可。Ansible模块会为你处理剩下的事情。

撰写回答