使用Anaconda管理Python环境

修改镜像源

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes

  

使用 conda 命令工具

1> 搭建环境

(1) 基于python3.6版本创建一个名字为python36的环境
conda create --name python36 python=3.6

(2) 激活此环境
source activate python36

(3) 退出当前环境
deactivate python36 

(4) 删除该环境
conda remove -n python36 --all

PS:可同时创建多个环境,查看所有激活的环境

conda info -e

 

2> 包管理

# 安装包 
conda install requests

# 查看已安装的包
conda list 

# 包更新
conda update requests

# 删除包
conda remove requests

 

安装依赖

conda install --yes --file requirements.txt

  

233

 

posted on 2019-05-19 22:35  Lemo_wd  阅读(476)  评论(0)    收藏  举报

导航