Python 获取安装在 Anaconda 中的软件包列表
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/46375576/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
get list of packages installed in Anaconda
提问by Regi Mathew
Over a period of time I have loaded a number of packages into the Anaconda I have been using. Now I am not able to keep track of it. How do we get a list of all packages loaded in Anaconda (windows10)? What is the command?
在一段时间内,我已经将许多软件包加载到我一直在使用的 Anaconda 中。现在我无法跟踪它。我们如何获取 Anaconda (windows10) 中加载的所有包的列表?命令是什么?
回答by Reblochon Masque
in terminal, type : conda listto obtain the packages installed using conda.
在终端中,键入 :conda list以获取使用 conda 安装的软件包。
for the packages that piprecognizes, type : pip list
对于pip识别的包,键入:pip list
There may be some overlap of these lists as pipmay recognize packages installed by conda(but maybe not the other way around, IDK).
这些列表可能有一些重叠,因为pip可以识别由conda(但可能不是相反,IDK)安装的软件包。
There is a useful source here, including how to update or upgrade packages..
有一个有用的来源在这里,包括如何更新或升级包..
回答by Rohaifa Khaldi
To list all of the packages in the active environment, use:
要列出活动环境中的所有包,请使用:
conda list
To list all of the packages in a deactivated environment, use:
要列出停用环境中的所有软件包,请使用:
conda list -n myenv
回答by A. Genedy
To check if a specific package is installed:
要检查是否安装了特定的软件包:
conda list html5lib
which outputs something like this if installed:
如果安装,它会输出如下内容:
# packages in environment at C:\ProgramData\Anaconda3:
#
# Name Version Build Channel
html5lib 1.0.1 py37_0
or something like this if not installed:
如果没有安装,或者类似的东西:
# packages in environment at C:\ProgramData\Anaconda3:
#
# Name Version Build Channel
you don't need to type the exact package name. Partial matches are supported:
您不需要键入确切的包名称。支持部分匹配:
conda list html
This outputs all installed packages containing 'html':
这将输出所有包含“html”的已安装包:
# packages in environment at C:\ProgramData\Anaconda3:
#
# Name Version Build Channel
html5lib 1.0.1 py37_0
sphinxcontrib-htmlhelp 1.0.2 py_0
sphinxcontrib-serializinghtml 1.1.3 py_0
回答by Carmo Melo
For script creation at Windows cmd or powershell prompt:
在 Windows cmd 或 powershell 提示符下创建脚本:
C:\ProgramData\Anaconda3\Scripts\activate.bat C:\ProgramData\Anaconda3
conda list
pip list

