先更新一下
sudo apt update
sudo apt upgrade
安装必要的环境
sudo apt install build-essential
sudo apt install python3.8
装conda
wget https://repo.anaconda.com/miniconda/Miniconda3-py38_22.11.1-1-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
运行bash,进入conda环境。
换源
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/pytorch/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
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/msys2/
新建一个conda环境
conda create --name myfl python=3.8
切换环境
conda activate myfl
pip换源(可以不执行)
#1.临时换源:
#清华源
pip3 install markdown -i https://pypi.tuna.tsinghua.edu.cn/simple
阿里源
pip3 install markdown -i https://mirrors.aliyun.com/pypi/simple/
腾讯源
pip3 install markdown -i http://mirrors.cloud.tencent.com/pypi/simple
豆瓣源
pip3 install markdown -i http://pypi.douban.com/simple/
#2.永久换源:
清华源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
阿里源
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
腾讯源
pip config set global.index-url http://mirrors.cloud.tencent.com/pypi/simple
豆瓣源
pip config set global.index-url http://pypi.douban.com/simple/
安装torch torchvision
pip3 install torch torchvision -i http://mirrors.cloud.tencent.com/pypi/simple --trusted-host mirrors.cloud.tencent.com
# 或者
pip3 install torch torchvision -i https://mirrors.cloud.tencent.com/pypi/simple
安装包
conda install grpcio grpcio-tools protobuf=3.20.1 scipy=1.4.1 psutil pyyaml