使用miniconda创建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:\miniconda3\envs\PCC
TDD                      D:\miniconda3\envs\TDD
Web_Spider               D:\miniconda3\envs\Web_Spider
oldBoy18                 D:\miniconda3\envs\oldBoy18
oldboy                   D:\miniconda3\envs\oldboy

删除指定的环境

conda env remove -n oldBoy18

导出当前环境的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:\miniconda3\envs\oldboy

导入他人的开发环境

conda env create -f environment.yaml

参考:

https://www.cnblogs.com/lcfzh/p/10463.html

分享你的喜爱

留下评论

您的电子邮箱地址不会被公开。 必填项已用*标注