anaconda 虚拟环境+清华源安装 pytorch

  1. 下载anaconda
  2. 创建虚拟环境

-n 指定虚拟环境名称(pytorch), python=3.9(不指定默认使用anaconda base python 版本)

conda create -n pytorch
3. 进入虚拟环境
activate pytorch
4. 安装 pytorch , 使用官网方法的pip方式 :https://pytorch.org/
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116
改进方式, 首先搜索清华源 路径
pip3 install torch torchvision torchaudio -i https://pypi.tuna.tsinghua.edu.cn/simple --extra-index-url https://download.pytorch.org/whl/cu116

虚拟环境使用安装包离线方式安装(gdal库为例)
pip install C:\Users\Administrator\Downloads\GDAL-3.4.3-cp39-cp39-win_amd64.whl

posted @ 2023-02-14 20:19  mlj0503  阅读(547)  评论(0编辑  收藏  举报