1.首先如果没有linux基础的话建议补一下b站黑马程序员新版Linux零基础快速入门到精通,全涵盖linux系统知识、常用软件环境部署、Shell脚本、云平台实践、大数据集群
2.刷完以上课程后就拥有了一个linux虚拟机
然后ctrl+alt+t打开linux终端
3.更新系统
sudo apt update
4.用于在 Ubuntu 或基于 Debian 的发行版上安装构建软件所需要的工具集的命令。它通常用于安装编译器、标准库、构建工具和其他必要的开发依赖项。
sudo apt install build-essential
ps:老师只输入了build-ess后再按下tab键自动补齐了命令
5.安装python(可以替换成你喜欢的版本)
sudo apt install python3.8
6.安装miniconda
浏览器搜索miniconda并找到对应的环境和python版本
或直接复制下面的命令
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
bash
7.通过bash已经进入到conda环境 安装需要的包
pip install jupyter d2l torch torchvision
但是一般会报错,需要用到镜像源,这里用的是清华源
pip install jupyter -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install d2l -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install torch -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install torchvision -i https://pypi.tuna.tsinghua.edu.cn/simple
发现速度提高了巨多。。。
8.下载上课所需的Jupyter记事本文件
wget https://zh-v2.d2l.ai/d2l-zh.zip
9.解压包
sudo apt install zip
ls
unzip d2l-zh.zip
10.git clone教材
git clone https://github.com/d2l-ai/d2l-zh-pytorch-slides
但是报错了fatal: unable to access 'https://github.com/.../.git': Could not resolve host: github.com
git config --global --unset http.proxy
git config --global --unset https.proxy
就解决了
11.运行(因为用的是虚拟机所以不需要老师的后续操作了,直接就成功了)
jupyter notebook
这是运行成功的界面~
如果觉得有用就点点赞吧~