1.安装Anaconda
第一条:wget https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh 第二条:bash Anaconda3-2020.11-Linux-x86_64.sh 第三条:source ~/.bashrc
2. 创建虚拟环境
然后创建个虚拟环境(进入虚拟环境), conda env list 或 conda info -e 查看当前存在哪些虚拟环境 创建新的环境:conda create -n env_flow python=3.7 安装成功 进入虚拟环境: conda activate env_flow
其他的一些命令: 删除虚拟环境: 使用命令conda remove -n your_env_name(虚拟环境名称) --all, 即可删除。
删除环境中的某个包。 使用命令conda remove --name your_env_name package_name 即可
3. 换源
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 --set show_channel_urls yes
vim ~/.condarc 查看conda源
4. 安装pytorch
先产看cuda版本: nvcc --version 我的cuda版本是11.1
根据官网的命令: - pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html
复制代码 |