← 返回命令列表

Linux command

conda-env 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

List all environments

conda env list

Export the current environment to a YAML file

conda env export > [environment.yml]

Export only explicitly installed packages

conda env export --from-history > [environment.yml]

Create an environment from a YAML file

conda env create -f [environment.yml]

Create an environment with a specific name from a file

conda env create -n [env_name] -f [environment.yml]

Remove an environment

conda env remove --name [env_name]

Update an environment from a YAML file

conda env update -f [environment.yml]

说明

conda env manages conda environments including creation from specification files, export, and removal. The environment.yml format allows reproducible environment definitions that can include conda packages, pip packages, and channel specifications. Use export --from-history to create cross-platform environment files that only list explicitly requested packages rather than all resolved dependencies.

参数

list
List all conda environments.
create
Create an environment from a YAML specification file.
export
Export an environment definition to YAML.
remove
Remove an environment entirely.
update
Update an existing environment from a YAML file.
config
Configure environment-specific variables.
-n _NAME_, --name _NAME_
Name of the environment to operate on.
-f _FILE_, --file _FILE_
Path to the environment YAML file.
--from-history
(export) Only include packages explicitly installed by the user.
--no-builds
(export) Remove build specification from exported dependencies.

FAQ

What is the conda-env command used for?

conda env manages conda environments including creation from specification files, export, and removal. The environment.yml format allows reproducible environment definitions that can include conda packages, pip packages, and channel specifications. Use export --from-history to create cross-platform environment files that only list explicitly requested packages rather than all resolved dependencies.

How do I run a basic conda-env example?

Run `conda env list` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does list do in conda-env?

List all conda environments.