点冻结和conda列表之间的区别 [英] Difference between pip freeze and conda list
问题描述
我同时使用"pip Frozen"和"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 > requirements.txt
.当您准备将软件包分发给其他用户时,他们可以使用conda create --name <envname> --file requirements.txt
轻松复制您的环境和相关的依赖项.
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.
You might also find this table useful. It lists operation equivalences between conda
, pip
and virtualenv
.
这篇关于点冻结和conda列表之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!