I am Charmie

メモとログ

PyTorch installation failure by conflict on M1 Mac

  • Problem: installation failed because of conflicts with six.
  • How to fix: use pip3 instead of conda so that the package manager successfully install PyTorch and related modules.

What happen with conda install

% conda install pytorch torchvision torchaudio -c pytorch
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: / 
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed                                                                                                                        

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

Package six conflicts for:
torchvision -> six
pytorch -> mkl-service[version='>=2,<3.0a0'] -> six

Package pytorch conflicts for:
pytorch
torchaudio -> pytorch[version='1.2.0|1.3.0|1.3.1|1.4.0|1.5.0|1.5.1|1.6.0|1.7.0|1.7.1|1.8.0|1.8.1|1.9.0']
torchvision -> pytorch[version='1.2.0|1.3.0|1.3.1|1.4.0|1.5.0|1.5.1|1.6.0|1.7.0|1.7.1|1.8.0|1.8.1|1.9.0|>=1.1.0|>=1.0.0|>=0.4|>=0.3|>=0.2|1.7.1.*|1.3.1.*']

What happen with pip3 install

% pip3 install torch torchvision torchaudio
Collecting torch
  Downloading torch-1.9.0-cp39-none-macosx_10_9_x86_64.whl (127.9 MB)
     |████████████████████████████████| 127.9 MB 1.8 MB/s 
Collecting torchvision
  Downloading torchvision-0.10.0-cp39-cp39-macosx_10_9_x86_64.whl (13.8 MB)
     |████████████████████████████████| 13.8 MB 1.0 MB/s 
Collecting torchaudio
  Downloading torchaudio-0.9.0-cp39-cp39-macosx_10_9_x86_64.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 1.5 MB/s 
Collecting typing-extensions
  Downloading typing_extensions-3.10.0.0-py3-none-any.whl (26 kB)
Requirement already satisfied: numpy in /SOMEWHERE/anaconda3/envs/py39/lib/python3.9/site-packages (from torchvision) (1.20.2)
Requirement already satisfied: pillow>=5.3.0 in /SOMEWHERE/anaconda3/envs/py39/lib/python3.9/site-packages (from torchvision) (8.2.0)
Installing collected packages: typing-extensions, torch, torchvision, torchaudio
Successfully installed torch-1.9.0 torchaudio-0.9.0 torchvision-0.10.0 typing-extensions-3.10.0.0

Result

% conda list | grep torch
torch                     1.9.0                    pypi_0    pypi
torchaudio                0.9.0                    pypi_0    pypi
torchvision               0.10.0                   pypi_0    pypi