0

I have python 3.9 and I am trying to install pytorch current version (as of this writing 1.9). But when I do it I get the following error:

(synthesis) miranda9@Brandos-MBP ~ % 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.                                                                                                                                                                                                                                                                   failed                                                                                                                                                                                                                                                                                                                    

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

Output in format: Requested package -> Available versions

Package pytorch conflicts for:
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.*']
pytorch

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

I only had numpy installed so far...it's essentially a brand new env:

(synthesis) miranda9@Brandos-MBP ~ % conda list
# packages in environment at /Users/miranda9/.conda/envs/synthesis:
#
# Name                    Version                   Build  Channel
blas                      1.0                         mkl  
ca-certificates           2021.5.25            hecd8cb5_1  
certifi                   2021.5.30        py39hecd8cb5_0  
intel-openmp              2021.2.0           hecd8cb5_564  
libcxx                    10.0.0                        1  
libffi                    3.3                  hb1e8313_2  
mkl                       2021.2.0           hecd8cb5_269  
mkl-service               2.3.0            py39h9ed2024_1  
mkl_fft                   1.3.0            py39h4a7008c_2  
mkl_random                1.2.1            py39hb2f4e1b_2  
ncurses                   6.2                  h0a44026_1  
numpy                     1.20.2           py39h4b4dc7a_0  
numpy-base                1.20.2           py39he0bd621_0  
openssl                   1.1.1k               h9ed2024_0  
pip                       21.1.2           py39hecd8cb5_0  
python                    3.9.5                h88f2d9e_3  
readline                  8.1                  h9ed2024_0  
setuptools                52.0.0           py39hecd8cb5_0  
six                       1.16.0             pyhd3eb1b0_0  
sqlite                    3.35.4               hce871da_0  
tk                        8.6.10               hb0a8c7a_0  
tzdata                    2020f                h52ac0ba_0  
wheel                     0.36.2             pyhd3eb1b0_0  
xz                        5.2.5                h1de35cc_0  
zlib                      1.2.11               h1de35cc_3  

why is this happening and how do I fix this?


related/crossposted:

Charlie Parker
  • 5,884
  • 57
  • 198
  • 323

1 Answers1

1

For me it seems that adding conda-forge to the channels works. My understanding of why that works is that the pytorch channel doesn't have all packages or something (details here: https://github.com/pytorch/pytorch/issues/59517).

Do:

conda install -y pytorch torchvision torchaudio -c pytorch -c conda-forge

other example installations:

conda install -y pytorch==1.7.1 torchvision torchaudio cudatoolkit=10.2 -c pytorch -c conda-forge

Full output:

(synthesis) miranda9@Brandos-MBP ~ % conda install pytorch torchvision torchaudio -c pytorch -c conda-forge
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /Users/miranda9/.conda/envs/synthesis

  added / updated specs:
    - pytorch
    - torchaudio
    - torchvision


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    bzip2-1.0.8                |       h0d85af4_4         155 KB  conda-forge
    ca-certificates-2021.5.30  |       h033912b_0         136 KB  conda-forge
    certifi-2021.5.30          |   py39h6e9494a_0         141 KB  conda-forge
    ffmpeg-4.3                 |       h0a44026_0        10.1 MB  pytorch
    freetype-2.10.4            |       h4cff582_1         890 KB  conda-forge
    gettext-0.19.8.1           |    h7937167_1005         3.3 MB  conda-forge
    gmp-6.1.2                  |    h0a44026_1000         734 KB  conda-forge
    gnutls-3.6.13              |       hc269f14_0         2.1 MB  conda-forge
    lame-3.100                 |    h35c211d_1001         521 KB  conda-forge
    libiconv-1.16              |       haf1e3a3_0         1.3 MB  conda-forge
    libpng-1.6.37              |       h7cec526_2         313 KB  conda-forge
    libuv-1.41.0               |       hbcf498f_0         421 KB  conda-forge
    libwebp-base-1.2.0         |       h0d85af4_2         700 KB  conda-forge
    lz4-c-1.9.2                |       h4a8c4bd_1         169 KB  conda-forge
    nettle-3.4.1               |    h3efe00b_1002         1.0 MB  conda-forge
    ninja-1.10.2               |       hf7b0b51_1         106 KB
    olefile-0.46               |     pyh9f0ad1d_1          32 KB  conda-forge
    openh264-2.1.1             |       hd174df1_0         1.5 MB  conda-forge
    openssl-1.1.1k             |       h0d85af4_0         1.9 MB  conda-forge
    pillow-8.2.0               |   py39h5270095_0         587 KB
    python_abi-3.9             |           1_cp39           4 KB  conda-forge
    pytorch-1.9.0              |          py3.9_0        79.0 MB  pytorch
    torchaudio-0.9.0           |             py39         4.0 MB  pytorch
    torchvision-0.10.0         |         py39_cpu         6.8 MB  pytorch
    typing_extensions-3.10.0.0 |     pyha770c72_0          28 KB  conda-forge
    ------------------------------------------------------------
                                           Total:       115.8 MB

The following NEW packages will be INSTALLED:

  bzip2              conda-forge/osx-64::bzip2-1.0.8-h0d85af4_4
  ffmpeg             pytorch/osx-64::ffmpeg-4.3-h0a44026_0
  freetype           conda-forge/osx-64::freetype-2.10.4-h4cff582_1
  gettext            conda-forge/osx-64::gettext-0.19.8.1-h7937167_1005
  gmp                conda-forge/osx-64::gmp-6.1.2-h0a44026_1000
  gnutls             conda-forge/osx-64::gnutls-3.6.13-hc269f14_0
  jpeg               pkgs/main/osx-64::jpeg-9b-he5867d9_2
  lame               conda-forge/osx-64::lame-3.100-h35c211d_1001
  lcms2              pkgs/main/osx-64::lcms2-2.12-hf1fd2bf_0
  libiconv           conda-forge/osx-64::libiconv-1.16-haf1e3a3_0
  libpng             conda-forge/osx-64::libpng-1.6.37-h7cec526_2
  libtiff            pkgs/main/osx-64::libtiff-4.2.0-h87d7836_0
  libuv              conda-forge/osx-64::libuv-1.41.0-hbcf498f_0
  libwebp-base       conda-forge/osx-64::libwebp-base-1.2.0-h0d85af4_2
  lz4-c              conda-forge/osx-64::lz4-c-1.9.2-h4a8c4bd_1
  nettle             conda-forge/osx-64::nettle-3.4.1-h3efe00b_1002
  ninja              pkgs/main/osx-64::ninja-1.10.2-hf7b0b51_1
  olefile            conda-forge/noarch::olefile-0.46-pyh9f0ad1d_1
  openh264           conda-forge/osx-64::openh264-2.1.1-hd174df1_0
  pillow             pkgs/main/osx-64::pillow-8.2.0-py39h5270095_0
  python_abi         conda-forge/osx-64::python_abi-3.9-1_cp39
  pytorch            pytorch/osx-64::pytorch-1.9.0-py3.9_0
  torchaudio         pytorch/osx-64::torchaudio-0.9.0-py39
  torchvision        pytorch/osx-64::torchvision-0.10.0-py39_cpu
  typing_extensions  conda-forge/noarch::typing_extensions-3.10.0.0-pyha770c72_0
  zstd               pkgs/main/osx-64::zstd-1.4.5-h41d2c2f_0

The following packages will be UPDATED:

  ca-certificates    pkgs/main::ca-certificates-2021.5.25-~ --> conda-forge::ca-certificates-2021.5.30-h033912b_0

The following packages will be SUPERSEDED by a higher-priority channel:

  certifi            pkgs/main::certifi-2021.5.30-py39hecd~ --> conda-forge::certifi-2021.5.30-py39h6e9494a_0
  openssl              pkgs/main::openssl-1.1.1k-h9ed2024_0 --> conda-forge::openssl-1.1.1k-h0d85af4_0


Proceed ([y]/n)? y


Downloading and Extracting Packages
freetype-2.10.4      | 890 KB    | ############################################################################################################################################################################################################################################################################# | 100% 
openh264-2.1.1       | 1.5 MB    | ############################################################################################################################################################################################################################################################################# | 100% 
openssl-1.1.1k       | 1.9 MB    | ############################################################################################################################################################################################################################################################################# | 100% 
gmp-6.1.2            | 734 KB    | ############################################################################################################################################################################################################################################################################# | 100% 
gnutls-3.6.13        | 2.1 MB    | ############################################################################################################################################################################################################################################################################# | 100% 
gettext-0.19.8.1     | 3.3 MB    | ############################################################################################################################################################################################################################################################################# | 100% 
libuv-1.41.0         | 421 KB    | ############################################################################################################################################################################################################################################################################# | 100% 
libpng-1.6.37        | 313 KB    | ############################################################################################################################################################################################################################################################################# | 100% 
olefile-0.46         | 32 KB     | ############################################################################################################################################################################################################################################################################# | 100% 
python_abi-3.9       | 4 KB      | ############################################################################################################################################################################################################################################################################# | 100% 
certifi-2021.5.30    | 141 KB    | ############################################################################################################################################################################################################################################################################# | 100% 
pillow-8.2.0         | 587 KB    | ############################################################################################################################################################################################################################################################################# | 100% 
torchaudio-0.9.0     | 4.0 MB    | ############################################################################################################################################################################################################################################################################# | 100% 
lz4-c-1.9.2          | 169 KB    | ############################################################################################################################################################################################################################################################################# | 100% 
pytorch-1.9.0        | 79.0 MB   | ############################################################################################################################################################################################################################################################################# | 100% 
typing_extensions-3. | 28 KB     | ############################################################################################################################################################################################################################################################################# | 100% 
ffmpeg-4.3           | 10.1 MB   | ############################################################################################################################################################################################################################################################################# | 100% 
lame-3.100           | 521 KB    | ############################################################################################################################################################################################################################################################################# | 100% 
torchvision-0.10.0   | 6.8 MB    | ############################################################################################################################################################################################################################################################################# | 100% 
libwebp-base-1.2.0   | 700 KB    | ############################################################################################################################################################################################################################################################################# | 100% 
ca-certificates-2021 | 136 KB    | ############################################################################################################################################################################################################################################################################# | 100% 
bzip2-1.0.8          | 155 KB    | ############################################################################################################################################################################################################################################################################# | 100% 
nettle-3.4.1         | 1.0 MB    | ############################################################################################################################################################################################################################################################################# | 100% 
ninja-1.10.2         | 106 KB    | ############################################################################################################################################################################################################################################################################# | 100% 
libiconv-1.16        | 1.3 MB    | ############################################################################################################################################################################################################################################################################# | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
Charlie Parker
  • 5,884
  • 57
  • 198
  • 323