Update python, anaconda, spyder and packages in Anaconda

Open Anaconda Promote

Configure mirror address

Configure the mirror address through the conda config command

#清华镜像
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
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/pytorch/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
#中科大镜像
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/
#显示通道地址
conda config --set show_channel_urls yes

Enter conda info in cmd or Anaconda Prompt to view the currently configured mirror source (corresponding to channel URLs) and configuration file path (config file). However, the anaconda Tsinghua mirror and the University of Science and Technology mirror were closed around the end of May
2019

update anaconda

Upgrade all kits

conda upgrade --all

update spyder

There are many posts giving suggestions similar to conda update anaconda; pip install --upgrade spyder. The following is the method I successfully implemented according to the official suggestion:

conda install spyder=4.0.0b7
#执行完后打开spyder,提示rtree版本不符
conda install rtree
#成功!

There are many possibilities for error reporting. For example, if the Solving environment is unsuccessful, uninstall the original version and then use the command successfully; another example is that the Spyder version to be tested does not have the correct spyder-kernels version installed. Spyder 3 corresponds to spyder-kernels 0.x, and Spyder 4 corresponds to spyder-kernels 1.x, which means that additional execution is required:

conda install -c spyder-ide spyder-kernels=1.*
#conda install -c <channel> <software>
#有些包在conda默认的channels中不包含,-c这个参数可以指定软件下载的镜像位置

update python

I am updating from 3.6 to 3.7
1. Go to the Python official website to download the installation package for the corresponding system (a bit troublesome)
2. Install the Python environment through the Anaconda suite (but there will be two anacondas after installation, to avoid conflicts, you need to uninstall the original one)
URL
download Then run it directly, except for a few items that need to be modified (listed below), click next for the rest. Note
insert image description here
insert image description hereinsert image description here: Do not directly conda update python! It may cause the version to be older, it will not work! Of course, if you need to specify the version of python, you can do this:

conda create -n py34 python=3.4 anaconda
conda activate py34 #激活这个新的配置环境
python --version #检查版本
#打开anaconda navigator,会现多出来一个可选择的环境

Install and update packages

conda install package_name
conda update package_name

pip3 install package_name
pip3 install --upgrade package_name

other links

  1. https://blog.csdn.net/weixin_41688854/article/details/89632779

Guess you like

Origin blog.csdn.net/weixin_43545069/article/details/103444003