pythonpytorchcondaminiconda

CondaVerificationError when installing PyTorch


I am trying to install pytorch using either of below command and I got a lot of error. I am using windows CPU only.

conda install pytorch::pytorch

or 
conda install pytorch torchvision torchaudio cpuonly -c pytorch

some of the error are

CondaVerificationError: The package for pytorch located at C:\Users\test\miniconda3\pkgs\pytorch-2.2.1-py3.10_cpu_0
appears to be corrupted. The path 'Lib/site-packages/torchgen/static_runtime/gen_static_runtime_ops.py'
specified in the package manifest cannot be found.

CondaVerificationError: The package for pytorch located at C:\Users\test\miniconda3\pkgs\pytorch-2.2.1-py3.10_cpu_0
appears to be corrupted. The path 'Lib/site-packages/torchgen/static_runtime/generator.py'
specified in the package manifest cannot be found.

CondaVerificationError: The package for pytorch located at C:\Users\test\miniconda3\pkgs\pytorch-2.2.1-py3.10_cpu_0
appears to be corrupted. The path 'Lib/site-packages/torchgen/utils.py'
specified in the package manifest cannot be found.

CondaVerificationError: The package for pytorch located at C:\Users\test\miniconda3\pkgs\pytorch-2.2.1-py3.10_cpu_0
appears to be corrupted. The path 'Lib/site-packages/torchgen/yaml_utils.py'
specified in the package manifest cannot be found.

CondaVerificationError: The package for pytorch located at C:\Users\test\miniconda3\pkgs\pytorch-2.2.1-py3.10_cpu_0
appears to be corrupted. The path 'Scripts/convert-caffe2-to-onnx-script.py'
specified in the package manifest cannot be found.

CondaVerificationError: The package for pytorch located at C:\Users\test\miniconda3\pkgs\pytorch-2.2.1-py3.10_cpu_0
appears to be corrupted. The path 'Scripts/convert-onnx-to-caffe2-script.py'
specified in the package manifest cannot be found.

CondaVerificationError: The package for pytorch located at C:\Users\test\miniconda3\pkgs\pytorch-2.2.1-py3.10_cpu_0
appears to be corrupted. The path 'Scripts/torchrun-script.py'
specified in the package manifest cannot be found.

Solution

  • One of your packages seems to be corrupt. You can try cleaning the packages from cache and reinstalling pytorch:

    conda clean -p