备忘单#
Cheatsheet
conda 备忘单包含有关使用 conda 的最重要的信息,例如创建和管理环境、安装包以及导入和导出环境的基本命令。
请参阅 conda cheatsheet
PDF(3 MB)以获取可下载的单页版本。
版本
The conda cheatsheet contains the most important information about using conda, such as basic commands for creating and managing environments, installing packages, and importing and exporting environments.
See the conda cheatsheet
PDF (3 MB) for a downloadable, single-page version.
Versions
conda 24.4.0
(latest)
快速入门#
Quickstart
小技巧
建议为任何新项目或工作流程创建一个新环境。
verify conda install and check version |
|
update conda in base environment |
|
install latest anaconda distribution (see release notes) |
|
create a new environment (tip: name environment descriptively) |
|
activate environment (do this before installing packages) |
|
小技巧
It is recommended to create a new environment for any new project or workflow.
verify conda install and check version |
|
update conda in base environment |
|
install latest anaconda distribution (see release notes) |
|
create a new environment (tip: name environment descriptively) |
|
activate environment (do this before installing packages) |
|
渠道和软件包#
Channels and Packages
小技巧
使用 conda 时会自动解析包依赖关系和平台细节。
list installed packages |
|
list installed packages with source info |
|
update all packages |
|
install a package from specific channel |
|
install specific version of package |
|
install package with AND logic |
|
install package with OR logic |
|
uninstall package |
|
view channel sources |
|
add channel |
|
set default channel for pkg fetching (targets first channel in channel sources) |
|
小技巧
Package dependencies and platform specifics are automatically resolved when using conda.
list installed packages |
|
list installed packages with source info |
|
update all packages |
|
install a package from specific channel |
|
install specific version of package |
|
install package with AND logic |
|
install package with OR logic |
|
uninstall package |
|
view channel sources |
|
add channel |
|
set default channel for pkg fetching (targets first channel in channel sources) |
|
使用 Conda 环境#
Working with Conda Environments
小技巧
在会话开始时列出环境。标有星号的环境表示处于活动状态。
list all environments and locations |
|
list all packages + source channels |
|
install packages in environment |
|
remove package from environment |
|
update all packages in environment |
|
环境管理#
Environment Management
小技巧
指定环境名称将 conda 命令限制在该环境中。
create environment with Python version |
|
clone environment |
|
rename environment |
|
delete environment by name |
|
list revisions made to environment |
|
restore environment to a revision |
|
uninstall package from specific channel |
|
小技巧
Specifying the environment name confines conda commands to that environment.
create environment with Python version |
|
clone environment |
|
rename environment |
|
delete environment by name |
|
list revisions made to environment |
|
restore environment to a revision |
|
uninstall package from specific channel |
|
导出环境#
Exporting Environments
小技巧
根据您的环境命名导出文件以保留您的环境名称。
cross-platform compatible |
|
platform + package specific |
|
platform + package + channel specific |
|
小技巧
Name your export file after your environment to preserve your environment name.
cross-platform compatible |
|
platform + package specific |
|
platform + package + channel specific |
|
导入环境#
Importing Environments
小技巧
导入环境时,conda 会解析平台和包的具体信息。
小技巧
When importing an environment, conda resolves platform and package specifics.
其他提示#
Additional Hints
get help for any command |
|
get info for any package |
|
run commands w/o user prompt, e.g., installing multiple packages |
|
remove all unused files |
|
examine conda configuration |
|
get help for any command |
|
get info for any package |
|
run commands w/o user prompt, e.g., installing multiple packages |
|
remove all unused files |
|
examine conda configuration |
|