conda命令

7/11/2019 condapython

# conda常用命令

# 查看版本号
conda --version
conda -V


# 获取帮助
conda --help
conda -h

# 查看某一命令的用法帮助,如update和remove命令
conda update --h
conda remove --h
#以上--help 也可以换成 -h

# 创建名为your_env_name的环境
conda create --name your_env_name

# 创建制定python版本的环境
conda create --name your_env_name python=2.7
conda create --name your_env_name python=3.5

# 创建包含某些包(如numpy,scipy)的环境
conda create --name your_env_name numpy scipy
# 创建指定python版本下包含某些包的环境
conda create --name your_env_name python=3.5 numpy scipy
# 为指定环境安装某个包
conda install -n env_name package_name 

# 列举当前所有环境
conda info --envs
conda env list
# 列出当前环境下所有安装的包
conda list
# 列举一个非当前活跃环境下的所有包
conda list -n your_env_name

# 进入某个环境
conda activate your_env_name
ubuntu 环境下:source conda activate env_name

# 退出当前环境
conda deactivate 

# 复制某个环境
conda create --name new_env_name --clone old_env_name

# 删除某个环境
conda remove --name your_env_name --all

# 查找的包有哪些版本可供安装
conda search --full-name python 

# 升级包
conda update conda
conda update anaconda
conda update anaconda-navigator

# 卸载

计算机控制面板-程序与应用-卸载        //windows
rm -rf anaconda    //ubuntu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61

# 补充

conda update -n base conda        //update最新版本的conda
conda create -n xxxx python=3.5   //创建python3.5的xxxx虚拟环境
conda activate xxxx               //开启xxxx环境
conda deactivate                  //关闭环境
conda env list                    //显示所有的虚拟环境
conda list         #查看已经安装的文件包
conda update xxx   #更新xxx文件包
conda uninstall xxx   #卸载xxx文件包

conda clean -p      # 删除没有用的包
conda clean -t      # tar打包
conda clean --all   # 清理未使用的包和缓存:

1
2
3
4
5
6
7
8
9
10
11
12
13

# 导出

导出环境到文件:conda env export > environment.yml
导入环境:conda env create -f environment.yml

创建环境快照:conda list --explicit > environment.txt
使用快照还原环境:conda install --file environment.txt

pip freeze requirements.txt
1
2
3
4
5
6
7
上次更新: 2024/09/10 17:37:12
最近更新
01
跨域的几种常见解决方案
04-03
02
react教程
03-01
03
前端抓包神器whistle
09-01