Debian 11
安装Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| // 安装Python3.9 sudo apt update sudo apt upgrade sudo apt install python3.9
// 设置别名 alias python="/usr/bin/python3"
// 验证python版本 python --version
// 安装pip sudo apt install python3-pip
// 验证pip版本 pip --version
|
安装Anaconda
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| // 安装依赖 sudo apt update sudo apt upgrade sudo apt install wget apt-transport-https gnupg2 software-properties-common
// 下载安装脚本 # 官方仓库:https://repo.anaconda.com/archive/ wget https://repo.anaconda.com/archive/Anaconda3-2022.10-Linux-x86_64.sh
// 运行安装脚本 bash Anaconda3-2022.10-Linux-x86_64.sh
// 加载环境变量 source ~/.bashrc
// 验证 Anaconda conda list
|
切换国内源
1 2 3 4 5
| // 永久更换 vi ~/.pip/pip.conf
// 临时更换 pip install <package> -i https://pypi.tuna.tsinghua.edu.cn/simple
|
国内源示例:
1 2
| [global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple
|
阿里云 https://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
1 2 3 4 5
| // 切换国内源 vi ~/.condarc
// 切换回默认源 conda config --remove-key channels
|
国内源示例:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| # 清华源 channels: - defaults show_channel_urls: true default_channels: - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2 custom_channels: conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud pytorch-lts: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
# 中科大源 channels: - https://mirrors.ustc.edu.cn/anaconda/pkgs/main/ - https://mirrors.ustc.edu.cn/anaconda/pkgs/free/ - https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/ ssl_verify: true
# 上交大源 channels: - https://mirrors.sjtug.sjtu.edu.cn/anaconda/pkgs/main/ - https://mirrors.sjtug.sjtu.edu.cn/anaconda/pkgs/free/ - https://mirrors.sjtug.sjtu.edu.cn/anaconda/cloud/conda-forge/ ssl_verify: true
|