使用Anaconda创建python虚拟环境
Posted 吾生也有涯,而知也无涯。
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用Anaconda创建python虚拟环境相关的知识,希望对你有一定的参考价值。
安装python指定环境
conda create -n oldboy python=3.6.5
安装环境的同时安装相应的包
conda create -n oldboy python=3.6.5 pandas
进入指定的环境
activate oldboy
退出当前环境
deactivate oldboy
显示所有的环境
conda env list
# conda environments:
#
base * D:miniconda3
PCC D:miniconda3envsPCC
TDD D:miniconda3envsTDD
Web_Spider D:miniconda3envsWeb_Spider
oldBoy18 D:miniconda3envsoldBoy18
oldboy D:miniconda3envsoldboy
删除指定的环境
conda env remove -n oldBoy18
Remove all packages in environment D:miniconda3envsoldBoy18:
## Package Plan ##
environment location: D:miniconda3envsoldBoy18
The following packages will be REMOVED:
certifi: 2016.2.28-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
Proceed ([y]/n)? y
导出当前环境的package信息
conda env export > environment.yaml
environment.yaml
name: oldboy
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- defaults
dependencies:
- python=3.6.5=h0c2934d_0
- certifi=2016.2.28=py36_0
- pip=9.0.1=py36_1
- setuptools=36.4.0=py36_1
- vc=14=0
- vs2015_runtime=14.0.25420=0
- wheel=0.29.0=py36_0
- wincertstore=0.2=py36_0
prefix: D:miniconda3envsoldboy
导入他人的开发环境
conda env create -f environment.yaml
以上是关于使用Anaconda创建python虚拟环境的主要内容,如果未能解决你的问题,请参考以下文章