Anaconda如何升级到新版

1,691 阅读1分钟

Anaconda如何升级到新版

  • 首先进入程序 Anaconda Prompt
  • 添加国内源会快很多倍
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
​
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
  • 启动国内源
conda config --set show_channel_urls yes
  • 查看是否添加源成功 如果成功会在channels:的地方显示添加源的地址
conda config --show
  • 如何删除源??
conda config --remove channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
​
conda config --remove channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
  • 切记 切记 切记 在打开Anaconda Prompt的时候 一定要用管理员权限打开
conda update conda           # 升级conda到最新版
conda update anaconda        # 升级anaconda到最新版
conda update --all           # 升级配置环境
  • 最后加入环境变量即可
# 路径各有不同 根据自己的设定即可
D:\anaconda

D:\anaconda\Scripts\

D:\anaconda\Library\bin

D:\anaconda\Library\mingw-w64\bin
  • 遇到以下情况解决方法:
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run

    $ conda init <SHELL_NAME>

Currently supported shells are:
  - bash
  - fish
  - tcsh
  - xonsh
  - zsh
  - powershell

See 'conda init --help' for more information and options.

IMPORTANT: You may need to close and restart your shell after running 'conda init'.

解决方法如下:

 conda activate your_virtual_nam
————————————————