Installation

Hi @born_in2020, please make sure install requests within the d2l environment (i.e., after you source activate d2l, install it).

1 Like

hi,
I tried pip install d2l, but it still give error that No module named ‘d2l’.


pip install git+https://github.com/d2l-ai/d2l-en
Try this!
@Jian_Shi

Hi, just starting! When installing I’m getting an error that I don’t know what it is.

> pip install torch
Requirement already satisfied: torch in ./miniconda3/envs/d2l/lib/python3.8/site-packages (1.8.1)
Requirement already satisfied: numpy in ./miniconda3/envs/d2l/lib/python3.8/site-packages (from torch) (1.20.2)
Requirement already satisfied: typing-extensions in ./miniconda3/envs/d2l/lib/python3.8/site-packages (from torch) (3.7.4.3)
WARNING: Error parsing requirements for protobuf: [Errno 2] No such file or directory: '/scratch1/user/software/protobuf-3.12.2.dist-info/METADATA'

For those who encounter an error when installing the d2l package, please see the comments at Error when installing gym==0.21.0 from the setup.py · Issue #2443 · d2l-ai/d2l-en · GitHub

1 Like

Hi, as at the time I window-shopped this book months ago, JAX was one of the frameworks listed. But now I can’t find it here again. Is there no longer support for JAX here?

Hello, I’m getting this error when executing pip install d2l==1.0.0b0

Can somebody help please ?

By the way it works well when I don’t specify the version of d2l that I want.

Hey, I bumped into the same problem. Looks it’s from this particular version of gym. If you would install a higher 0.22.0 version by running “pip install git+https://github.com/openai/gym.git@0.22.0”, and then run “pip install d2l==1.0.0b0” to continue the d2l installation, the error could be gone. but not sure if the gym of higher version will break the integrity of d2l 1.0.0 itself at some point.

3 Likes

Hello!!
Thank you very much. I will try this for sure

If you meet the error “python setup.py egg_info did not run successfully.”, see this question: why-is-pip-install-gym-failing-with-python-setup-py-egg-info-did-not-run-succ

Thank you for the details; your steps helped resolve this for my similar installation problems.

This also worked for me, thank you.

It helped me a great deal! thx a lot

image
Great thanks.

Are there any plans to add MPS support? I bet a lot of people are reading (at least the early sections) using their Macs, me included

Just run conda deactivate to deactivate the current environment, no need to specify the environment name.

Hi, when I type “jupyter notebook” in the command prompt, I did not see any of the course folder in the localhost website. I only see my old ipynb files from past coursework. What should I do?

What are the pytorch installation instruction for devices with Intel Arc GPUs?

I have an issue while installing the d2l package
when i run the command pip install d2l==1.0.3

Instead of conda, I used uv. Initially I had problems installing torch=2.0.0 such as my Cuda version is 12.2. Thus, I used Python 3.9 with the following dependencies:

requires-python = ">=3.9"
dependencies = [
    "d2l>=1.0.3",
    "torch>=2.6.0",
    "torchaudio>=2.6.0",
    "torchvision>=0.21.0",
]