Home > Blockchain >  PyTorch Installation - PiP - Erorr
PyTorch Installation - PiP - Erorr

Time:02-20

I downloaded the latest version of pip, pip 22.0.3

When trying to install PyTorch , by entering the command below,

pip3 install torch==1.10.2 cu113 torchvision==0.11.3 cu113 torchaudio===0.10.2 cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html

I get the following Error

Error - "The Package index page used does not have a proper HTML doctype declaration."

it says to contact the owner of the package index, to get this fixed. https://github/com/pypa/pip.issues/10825

Any solutions for this ? i want to install PyTorch

CodePudding user response:

Seems like it's an ongoing issue with pip==22.0.{0,1,2,3} (confirm your pip version using pip3 --version or pip --version). They started a migration process to remove an HTML parser 1, but it seems like PyTorch didn't notice and now they're trying to solve it (this is the GitHub issue where they're tracking the progress on this matter).

At the moment, it seems like you have these options:

  1. Try to use the pip install command by adding this flag: --use-deprecated=html5lib. For example:

    pip3 install --use-deprecated=html5lib torch==1.10.2 cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html
    
  2. Downgrade pip to a "non-22.0.*" version. It seems like the recommended way is to use a version that comes with your Python version 2:

    python -m pip uninstall pip && python -m ensurepip
    
  3. Install PyTorch using a different technique.

  • Related