Anaconda3常用命令

2019-05-17  本文已影响0人  遇事不决_可问春风_

(1)conda环境管理

  conda create -n xxx  package   #创建环境
  activate xxx  #激活环境
  deactivate xxx  #离开环境
  conda env list    #显示所有conda虚拟环境
  conda env remove -n xxx  #删除环境
  conda create -n A --clone  B        # 将环境B复制到A

注:xxx表示环境名

(2)Jupyter noterbook 中添加新kernel

  pip install ipykernel   # 先安装ipykernel
  python -m ipykernel install --name xxxx  # 设置内核
  jupyter kernelspec list   # 查看jupyter notebook设置的所有内核
  jupyter kernelspec remove xxx # 删除对应的内核

(3)为Anaconda的添加清华镜像

  conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
  conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
  conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
# 设置搜索时显示通道地址
  conda config --set show_channel_urls yes  

(4)其他

  package --version   看包的版本
  python -m pip install --upgrade pip      更新pip
上一篇 下一篇

猜你喜欢

热点阅读