-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't install d2l 1.0.3 on python 3.12.4 #2608
Comments
The authors mention testing with Python 9. I haven't tried the ML code yet, but installation completes with the latest iteration of Python 11: mkdir 'D2L Jupyter Notebooks'
cd !$
curl -sSLO https://github.com/d2l-ai/d2l-en/releases/download/v1.0.3/d2l-en-1.0.3.zip
unzip ./d2l-en-1.0.3.zip
rm -rf __*
asdf install python 3.11
asdf local python 3.11
pip install -U pip wheel
pip install -U jupyterlab numpy
pip install -U install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
pip install -U d2l
cd pytorch/chapter_preliminaries
jupyter lab Finally, double-click on index.ipynb in JupyterLab's file browser. |
Hi @slewsys ! 🙂 I think It should be upgraded, doesn't it ? I can't go back to 3.9 or 3.11. Numpy is 2.0.0 and Python is 3.14. They are faster and many improvements. I don't use Jupyter. I use Spyder. Before upgrade Python, I was testing the code on 3.11 and it was working quite well. But, go back to 3.11... I can't. Sorry. 😇 |
The following works for me using Python 3.12.4. I didn't adjust the version in d2l/__init__.py because only setup.py is modified: git clone https://github.com/d2l-ai/d2l-en.git
cd ./d2l-en
patch <<EOF
--- setup.py.orig 2024-07-19 06:38:57.169915071 +000
+++ setup.py 2024-07-19 06:40:25.545595707 +000
@@ -2,13 +2,13 @@
import d2l
requirements = [
- 'jupyter==1.0.0',
- 'numpy==1.23.5',
- 'matplotlib==3.7.2',
- 'matplotlib-inline==0.1.6',
- 'requests==2.31.0',
- 'pandas==2.0.3',
- 'scipy==1.10.1'
+ 'jupyterlab==4.2.2',
+ 'numpy==2.0.0',
+ 'matplotlib==3.9.1',
+ 'matplotlib-inline==0.1.7',
+ 'requests==2.32.3',
+ 'pandas==2.2.2',
+ 'scipy==1.14.0'
]
setup(
EOF
pip install -U pip wheel setuptools
python ./setup.py bdist_wheel
pip install -U ./dist/d2l-1.0.3-py3-none-any.whl |
Man ! You nailed it ! But, could the requirements be like 'numpy>=1.23.5' ? |
Bad news, @slewsys... 🙁 This is the message after executing the code: Ok. We tried. Let's go back to square one. D2l should be upgraded in its code to numpy 2.0.0, isn't it ? |
I'm not sure what module was compiled with NumPy 1.x? Python does a poor job of dependency resolution. So the burden is on the user to create a pristine environment for Python when installing packages with lots of dependencies. The most common way of doing that is with a so-called virtual environment: python -m venv d2l-venv
source d2l-venv/bin/activate
# Inside the Python virtual environment d2l-venv, run:
pip install -U pip wheel
pip install -U dist/d2l-1.0.3-py3-none-any.whl You'll want to reinstall Spyder and so on in this virtual environment as well. To leave the virtual environment, run: deactivate To return to the virtual environment at some later point, source d2l-venv/bin/activate If you still encounter issues, try to provide the steps needed to reproduce the problem. Hope that helps! |
Almost there. The virtual environment worked quite well. Everything installed. But now the problem is spyder. It's getting segmentation fault when launching. I see python 3.12 as interpreter in the virtual environment. I think it won't work. We are trying to make a solution for something downgraded. |
The D2L Package version 1.0.3 requires numpy 1.23.5. Python 3.12.4/pip 24.1 consider it(numpy 1.23.5) depreciated and does not conclude the installation. It's needed to update the D2L package to depend on numpy 2.0.0. I'm waiting for it.
Regards.
The text was updated successfully, but these errors were encountered: