pip freeze 和 conda list 的区别 [英] Difference between pip freeze and conda list
问题描述
我同时使用pip freeze"和conda list"来列出我的环境中安装的软件包,但它们有什么区别?
I am using both "pip freeze" and "conda list" to list the packages installed in my environment, but what are their differences?
推荐答案
如果目标只是列出所有已安装的包,pip list
或 conda list
是要走的路.
If the goal only is to list all the installed packages, pip list
or conda list
are the way to go.
pip freeze
与 conda list --export
一样,更多地用于为您的环境生成需求文件.例如,如果您在自定义环境中创建了具有某些依赖项的包,则可以执行 conda list --export >要求.txt
.当您准备好将您的包分发给其他用户时,他们可以使用 conda create --name
.
pip freeze
, like conda list --export
, is more for generating requirements files for your environment. For example, if you have created a package in your customized environment with certain dependencies, you can do conda list --export > requirements.txt
. When you are ready to distribute your package to other users, they can easily duplicate your environment and the associated dependencies with conda create --name <envname> --file requirements.txt
.
conda
和 pip
之间的区别需要更长时间的讨论.StackOverflow 上有很多解释.这篇文章 作者:Jake VanderPlas也可以阅读.
The differences between conda
and pip
need a longer discussion. There are plenty of explanations on StackOverflow. This article by Jake VanderPlas is a great read as well.
您可能还会发现 这张表很有用.它列出了 conda
、pip
和 virtualenv
之间的操作等价.
You might also find this table useful. It lists operation equivalences between conda
, pip
and virtualenv
.
这篇关于pip freeze 和 conda list 的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!