1。诗歌添加< package> gt; vs 2。a)诗歌壳,然后b)pip install< package>
我想知道当我们使用vs vs使用
poetry shell
,然后使用pip pip安装安装,我想在虚拟设备中产生shell时,有什么区别安装< package>
。我可以发现的一个区别是pip install
方法不会将软件包添加到“ pyproject.toml”文件中。但是,在从诗歌外壳中进行PIP安装后,当我做诗歌添加<同一软件包>
时,诗歌确实已经识别已经安装了软件包,并且确实在依赖关系文件中添加了软件包信息。
这样做的原因是,很少有软件包不适用于诗歌添加
方法,而是使用pip install
方法。因此,想更好地了解引擎盖下的情况。
I am wondering what is the difference when we do poetry add <package>
vs spawning a shell in the virtual env using poetry shell
and then installing using pip pip install <package>
. One difference I can spot is pip install
method does not add the package to "pyproject.toml" file. However, after doing the pip install from the poetry shell, when I do poetry add <same package>
, poetry does recognize the package has already been installed and it does add the package information in the dependency file.
The reason for doing this is few packages do not work with the poetry add
method on my system but work with the pip install
method. Hence wanted to get a better understanding of what is happening under the hood.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
“诗歌添加”用于代替“ PIP安装”; “诗歌壳”是用于激活虚拟环境的命令...
这是在虚拟环境上的一些良好阅读(以及如何专门使用诗歌):
"poetry add " is used in place of "pip install "; "poetry shell" is the command used to activate the virtual environment...
here is some good reading on virtual environments (and how to use poetry specifically):