# sanity check that the path to the python
# binary matches that of the anaconda env
# after you activate it
which python
To deactivate the environment, either run conda deactivate d2l or exit the terminal. Note that every time you want to work on the assignment, you should rerun conda activate d2l . manage-environments Reference
I still suggest to use conda install to install pytorch
For Chinese users:
In CMD, conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud//pytorch/
Then look https://pytorch.org/get-started/locally/ to install.
For me,
Thanks Steven,
I already tried the approaches suggested in https://github.com/jupyter/help/issues/67. But they were of no help. I even tried renaming them with a .html extension but it didn’t help either.
Once all packages are installed, you can open the Jupyter notebook by
jupyter notebook
At this point open http://localhost:8888 (which usually opens automatically) in the browser, then you can view and run the code in each section of the book.
I got the same error when I tried to run notebooks with .ipynb extension. Looking closely at the files listed, I noticed that several files were 0 B in size. Selecting files with valid size (i.e., which have some content in them) works as expected.
It’s not clear to me why the empty files exist in the first place. Perhaps they can be removed. Hope that helps.
Hi all! I am also using the pytorch version of the notebooks (downloaded today, 25.Oct.20) and get the error that the notebooks cannot be read. There seem to be two reasons for this, both are bugs in the way the d2l team builds the books. One source of errors is the fact that some notebooks haven’t added the pytorch code yet. Instead of adding a note saying something like ‘not implemented yet’ it just produces a notebook of the size 0. The other source of errors is that those markdown files (which are the source of the notebook files), which don’t have a tag ‘pytorch’ included, are not converted to pytorch notebooks. This includes all index files (and I think generally all files without code). If you have the time, you could fix the first error in the build system (https://github.com/d2l-ai/d2l-book) . The second error needs to be fixed in the markdown files for the book, they need to add a tab all directive there (so I gather from the discussion on the build system). What we can do to get the index files and other text files: copy these files from the mxnet branch. They have no code and work also with the pytorch branch.
Hi @fotis we are working to add the pytorch code blocks for the chapters which are still left. Once those are added the notebook versions of the same will be available.
Probably @mli can shed some light on whether we’ll add a “Not Implemented Yet” mark to the chapters left.
open your anaconda
2.click botton “Enviroment”
3.click botton “d2l” (if you have finished Installation’s order ,you will find “d2l” )
4.select “not installed” and search “requests”(and you will find it on the list)
click “Appliy” botton
6.reactivate the d2l environment.
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?
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.
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?
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:
Anyone attempting to install d2l into a recent version of python will experience the same problems as PlacideKad above, due to explicit dependencies. Building the binary for the specified version is unlikely to work because of the removal of a deprecated feature in pkgutil. Python 3.12 can use numpy version 1.26+, so until there’s a new release, you can use:
pip install numpy==1.26.4 or pip install "numpy<2" and then install d2l with pip install --no-deps d2l. pip will complain about incompatibilities every time you run it, but the examples may still work. Or they may not. Ideally we would have a release that can work with numpy 2. There has not been a new release since August 2023, which makes me wonder.