Conda 常用命令整理

conda 版本

conda --version
conda -V

conda 命令帮助

conda update --help
conda remove --help

例如conda info --help

C:\Users\1\Desktop>conda info --help
usage: conda-script.py info [-h] [--json] [-v] [-q] [-a] [--base] [-e] [-s]
                            [--unsafe-channels]

Display information about current conda install.

Options:

optional arguments:
  -h, --help         Show this help message and exit.
  -a, --all          Show all information.
  --base             Display base environment path.
  -e, --envs         List all known conda environments.
  -s, --system       List environment variables.
  --unsafe-channels  Display list of channels with tokens exposed.

Output, Prompt, and Flow Control Options:
  --json             Report all output as json. Suitable for using conda
                     programmatically.
  -v, --verbose      Use once for info, twice for debug, three times for
                     trace.
  -q, --quiet        Do not display progress bar.

环境管理

查看已配置的python环境

conda info --envs
conda env list

C:\Users\1\Desktop>conda info --envs
# conda environments:
#
base                  *  F:\Devs\Anaconda3
py2                      F:\Devs\Anaconda3\envs\py2

创建环境

conda create --name your_env_name

创建制定python版本的环境

conda create --name your_env_name python=2.7
conda create --name your_env_name python=3
conda create --name your_env_name python=3.5

创建包含某些包的环境

conda create --name your_env_name numpy scipy

创建指定python版本下包含某些包的环境

conda create --name your_env_name python=3.5 numpy scipy

进入某个环境

source activate your_env_name

退出当前环境

source deactivate 
conda deactivate

复制某个环境

conda create --name new_env_name --clone old_env_name 

删除某个环境

conda remove --name your_env_name --all

conda 包管理

列举当前活跃环境下的所有包

conda list

列举某个环境下的的包

conda list -n your_env_name

为指定环境安装某个包

conda install -n env_name package_name

参考

Conda常用命令整理---创建环境----conda create --name your_env_name python=3.7

posted @ 2021-11-08 14:02  采男孩的小蘑菇  阅读(202)  评论(0编辑  收藏  举报