1。诗歌添加< package> gt; vs 2。a)诗歌壳,然后b)pip install< package>

发布于 2025-01-27 06:44:42 字数 395 浏览 5 评论 0原文

我想知道当我们使用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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

挽你眉间 2025-02-03 06:44:42

“诗歌添加”用于代替“ 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):

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文