If any of the above solutions didn't solve the issue. You could try doing the following to help get rid of the error of being unable to install d2l package on Windows.
Download the Python version >3.10 & < 3.11
update the torch and torchvision versions to 2.3 and 0.18 with the command.
pip install torch==2.3 torchvision==0.18
Download the d2l-en package using the command.
git clone https://github.com/d2l-ai/d2l-en.git cd ./d2l-en
Upgrade the version of numpy from from 1.23.5 to 1.26.4 in the setup.py file
Update the setup tools
pip install -U setuptools
Install wheel and bdist_wheel as version pip does auto download those packages
pip install wheel python setup.py bdist_wheel
Run the following commands to finally download the d2l package.
python ./setup.py bdist_wheel pip install -U ./dist/d2l-1.0.3-py3-none-any.whl pip install d2l==1.0.3
These steps helped me get rid of the issue and it works like a charm.
Thanks.