You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3.9 KiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

一、国内源下载

https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/

二、官网安装

1、首先进入官网 https://repo.anaconda.com,选择View All Installers

2、这里是 Anaconda 的各种安装包版本,Anaconda3就代表Python3的版本后面是发行日期我选择了2022.10的Windows版本而且是64位的,下载到本地。

3、运行安装包然后跟着下面每一步操作。

这一步是安装路径,我是放在了D盘中的Anaconda3文件夹中。

这一步显示默认环境是Python3.9,然后install

等待安装,安装过程不会很长。

去掉两个框中的勾,然后Finish完成,至此安装成功。

配置环境变量

添加安装目录及相应bin目录到Path

setx PATH "%PATH%;G:\Anaconda3;G:\Anaconda3\Scripts;G:\Anaconda3\Library\bin;G:\Anaconda3\Library\mingw-w64\bin" /M

配置国内镜像源

查看当前配置的镜像源

conda config --show-sources

输入下面命令配置为清华源

conda config --add channels    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/conda-forge/

4、测试是否安装成功

在菜单栏中打开Anaconda命令行,也就是Anaconda Promptanaconda3

点击后,如果能在命令行左侧的括号中看到base,则代表安装成功!

5、创建和激活环境

conda create -n py39 python=3.9

是创建python3.9版本,名称为py39的环境。这里环境名和python版本可以自己指定。

输入y,然后回车进行下载,下载和安装完会提示done,像这样就是安装好了。

conda activate py39激活环境

可以看到前面由base变成py39了,这就表示我们进入了该环境,大家可以直接把环境理解成文件夹。

conda deactivate 退出环境

就和我们平时用cmd命令行时cd切换目录很类似。

Anaconda的详细环境操作,可以看这里:anaconda创建和删除环境

查看已有的虚拟环境

conda env list