1 安装anaconda

官网安装

2. 创建d2l虚拟环境

conda create --name d2l python=3.8 -y

conda activate d2l

3. pip torch  torchvison

pip install torch==1.11.0
pip install torchvision==0.12.0

4. 安装cuda

笔记本没有显卡,直接就用cpu来跑

5. pip d2l

pip install d2l==0.17.5

6 报错

│ exit code: 1 ╰─> [6 lines of output] Cargo, the Rust package manager, is not installed or is not on PATH. This package requires Rust and Cargo to compile extensions. Install it through the system's package manager or via https://rustup.rs/ Checking for Rust toolchain.... [end of output]

 

无奈安装rust

https://cn.linux-terminal.com/?p=4641

conda  install conda-forge  rust

7 下载离线d2l

https://pypi.org/project/d2l/0.17.5/#files  whl版本

安装本地whl文件
输入指令:pip install E:\Software\Anaconda\envs\py38\Lib\site-packages\d2l-0.17.6-py3-none-any.whl

这里whl文件的前缀需要对应自己的目录,不要直接就copy我的

耐心等待安装完成

posted on 2024-12-05 17:40  混沌奇迹  阅读(182)  评论(0编辑  收藏  举报