1、查看conda当前配置 conda config --show channels
(base) PS C:\Users\Administrator> conda config --show channels
channels:
- defaults
2、配置源
### 添加通道
(base) PS C:\Users\Administrator> conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
### 设置搜索是显示通道地址
(base) PS C:\Users\Administrator> conda config --set show_channel_urls yes
3、恢复默认源
(base) PS C:\Users\Administrator> conda config --remove-key channels
4、删除旧镜像源
(base) PS C:\Users\Administrator> conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/tensorflow/linux/cpu/
5、创建环境
(base) PS C:\Users\Administrator> conda create -n AI python=3.6
Collecting package metadata (current_repodata.json): done
Solving environment: done
## Package Plan ##
environment location: D:\Anaconda3\envs\AI
added / updated specs:
- python=3.6
The following packages will be downloaded:
package | build
---------------------------|-----------------
certifi-2016.2.28 | py36_0 214 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
pip-9.0.1 | py36_1 1.7 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
python-3.6.2 | 0 31.5 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
setuptools-36.4.0 | py36_1 534 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
vc-14 | 0 703 B https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
vs2015_runtime-14.0.25420 | 0 2.0 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
wheel-0.29.0 | py36_0 129 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
wincertstore-0.2 | py36_0 14 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
------------------------------------------------------------
Total: 36.0 MB
The following NEW packages will be INSTALLED:
certifi anaconda/pkgs/free/win-64::certifi-2016.2.28-py36_0
pip anaconda/pkgs/free/win-64::pip-9.0.1-py36_1
python anaconda/pkgs/free/win-64::python-3.6.2-0
setuptools anaconda/pkgs/free/win-64::setuptools-36.4.0-py36_1
vc anaconda/pkgs/free/win-64::vc-14-0
vs2015_runtime anaconda/pkgs/free/win-64::vs2015_runtime-14.0.25420-0
wheel anaconda/pkgs/free/win-64::wheel-0.29.0-py36_0
wincertstore anaconda/pkgs/free/win-64::wincertstore-0.2-py36_0
Proceed ([y]/n)? y
Downloading and Extracting Packages
vc-14 | 703 B | ############################################################################ | 100%
wincertstore-0.2 | 14 KB | ############################################################################ | 100%
certifi-2016.2.28 | 214 KB | ############################################################################ | 100%
pip-9.0.1 | 1.7 MB | ############################################################################ | 100%
python-3.6.2 | 31.5 MB | #########################1 | 33%
vs2015_runtime-14.0. | 2.0 MB | ############################################################################ | 100%
wheel-0.29.0 | 129 KB | ############################################################################ | 100%
setuptools-36.4.0 | 534 KB | ############################################################################ | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
# $ conda activate AI
#
# To deactivate an active environment, use
#
# $ conda deactivate
6、激活环境 conda activate AI
(base) PS C:\Users\Administrator> conda activate AI
(AI) PS C:\Users\Administrator>
7、安装包 conda install numpy
(AI) PS C:\Users\Administrator> conda install numpy
Collecting package metadata (current_repodata.json): done
Solving environment: done
## Package Plan ##
environment location: D:\Anaconda3\envs\AI
added / updated specs:
- numpy
The following packages will be downloaded:
package | build
---------------------------|-----------------
blas-1.0 | mkl 6 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
mkl-2017.0.3 | 0 126.3 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
numpy-1.13.1 | py36_0 3.6 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
------------------------------------------------------------
Total: 129.9 MB
The following NEW packages will be INSTALLED:
blas anaconda/pkgs/free/win-64::blas-1.0-mkl
mkl anaconda/pkgs/free/win-64::mkl-2017.0.3-0
numpy anaconda/pkgs/free/win-64::numpy-1.13.1-py36_0
Proceed ([y]/n)? y
Downloading and Extracting Packages
mkl-2017.0.3 | 126.3 MB | ############################################################################ | 100%
numpy-1.13.1 | 3.6 MB | ############################################################################ | 100%
blas-1.0 | 6 KB | ############################################################################ | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
8、查看已安装的python包 conda list
(AI) PS C:\Users\Administrator> conda list
# packages in environment at D:\Anaconda3\envs\AI:
#
# Name Version Build Channel
blas 1.0 mkl https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
certifi 2016.2.28 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
mkl 2017.0.3 0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
numpy 1.13.1 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
pip 9.0.1 py36_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
python 3.6.2 0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
setuptools 36.4.0 py36_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
vc 14 0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
vs2015_runtime 14.0.25420 0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
wheel 0.29.0 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
wincertstore 0.2 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
9、查看已安装环境 conda info --envs
(AI) PS C:\Users\Administrator> conda info --envs
# conda environments:
#
base D:\Anaconda3
AI * D:\Anaconda3\envs\AI
10、删除包 conda remove pkg
conda remove pkg 删除自己和依赖包
conda remove pkg --force 只删自己,不删依赖包
11、删除虚拟环境
conda remove -n AI --all