一、安装Anaconda
Anaconda官网:https://www.anaconda.com
清华大学开源镜像下载:https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive
二、创建虚拟环境
conda creat -n Pytorch python=3.8
1.安装anaconda
Anaconda官网:https://www.anaconda.com
清华大学开源镜像下载:https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
安装时记住不要勾选Add path to,要后面自己手动配置:
安装好之后将如下三个环境变量加入系统变量中(根据自己的安装路径变化):
D:\Anaconda
D:\Anaconda\Scripts
D:\Anaconda\Library\bin
之后在cmd中确认conda已经成功安装:
2.换源
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
3.换回默认指令
conda config --remove-key channels
4.直接进NVIDIA官网:https://www.nvidia.cn/geforce/drivers/
4.创建虚拟环境
conda create -n pytorch python=3.8
删除虚拟环境
conda remove -n env_name --all
复制环境
conda create -n B --clone A
查看环境
conda info --envs
删除环境
conda remove -n octopus --all
GPU版:
cuda+对应cuda版本pytorch 下载到本地用pip安装
CPU版
pytorch官网
pip3 install torch torchvision torchaudio
删除目录文件
Remove-Item -Recurse -Force yolov5
pip安装依赖报错时:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ -r requirements.txt
删除包
pip uninstall xxx
1.查看pip源
pip config list
2.查看conda源
conda config --show-sources
三、安装jupyter
pip install jupyter -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install --user ipykernel
python -m ipykernel install --user --name=环境名
jupyter kernelspec list