conda-forge / jax-feedstock

A conda-smithy repository for jax.
BSD 3-Clause "New" or "Revised" License
5 stars 15 forks source link

conda installation or "conda jax" as a dependency of conda environment generates dependency "UnsatisfiableError" error. #125

Closed victoraalves closed 1 month ago

victoraalves commented 10 months ago

Solution to issue cannot be found in the documentation.

Issue

Similarly to https://github.com/google/jax/issues/15867, whenever I try to install jax via conda using

conda install jax -c conda-forge

I have the UnsatisfiableError:

(opyrability-env_5) C:\Users\vc00004>conda install -c conda-forge jax
Retrieving notices: ...working... done
Collecting package metadata (current_repodata.json): done
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
Solving environment: unsuccessful attempt using repodata from current_repodata.json, retrying with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: unsuccessful initial attempt using 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

The same happens if I try to create an environment from scratch, adding jax as depenency (both environment.yml or meta.yml when trying to create a recipe):

environment.yml:

name: opyrability-env
channels:
  - defaults
  - conda-forge
dependencies:
  - python>=3.9.0
  - setuptools>=61.2.0
  - numpy>=1.24.1
  - scipy>=1.10.0
  - tqdm>=4.64.0
  - matplotlib>=3.6.2
  - jax>=0.4.0
  - cvxopt>=1.2.7
  - cyipopt>=1.2.0
  - opyrability >= 1.1
  - polytope >=0.2.4

meta.yml (relevant part):

requirements:
  host:
    - python {{ python }}
    - setuptools >=61.2.0
    - poetry-core
    - wheel
    - setuptools-scm >=7.1.0
    - pip
    - cython
  run:
    - python {{ python }}
    - cython
    - numpy 
    - scipy
    - cvxopt
    - tqdm
    - matplotlib
    - polytope >=0.2.4,<0.3.0
    - jaxlib >=0.4.13,<0.5.0
    - jax >=0.4.13,<0.5.0
    - cyipopt >=1.2.0, <2.0.0

This doesn't happen if jax is not present in the dependencies, leading me to the conclusion that jax-feedstock installation might be the issue.

Installed packages

# packages in environment at C:\Users\vc00004\Anaconda3\envs\opyrability-env_5:
#
# Name                    Version                   Build  Channel
blas                      1.0                         mkl
brotli                    1.0.9                h2bbff1b_7
brotli-bin                1.0.9                h2bbff1b_7
bzip2                     1.0.8                he774522_0
ca-certificates           2023.05.30           haa95532_0
colorama                  0.4.6           py311haa95532_0
contourpy                 1.0.5           py311h59b6b97_0
cvxopt                    1.3.2           py311hc26bb91_0    conda-forge
cycler                    0.11.0             pyhd3eb1b0_0
cyipopt                   1.2.0           py311hee902c8_2    conda-forge
dsdp                      5.8                  h0a534c1_2
fftw                      3.3.10          nompi_h38027f0_108    conda-forge
fonttools                 4.25.0             pyhd3eb1b0_0
freetype                  2.12.1               ha860e81_0
giflib                    5.2.1                h8cc25b3_3
glib                      2.69.1               h5dc1a3c_2
glpk                      5.0                  h8ffe710_0    conda-forge
gsl                       2.7.1                h6051b90_1
icc_rt                    2022.1.0             h6049295_2
icu                       58.2                 ha925a31_3
iniconfig                 1.1.1              pyhd3eb1b0_0
intel-openmp              2023.1.0         h59b6b97_46319
ipopt                     3.14.12              ha9547d1_1    conda-forge
jpeg                      9e                   h2bbff1b_1
kiwisolver                1.4.4           py311hd77b12b_0
krb5                      1.20.1               h5b6d351_0
lerc                      3.0                  hd77b12b_0
libblas                   3.9.0           1_h8933c1f_netlib    conda-forge
libbrotlicommon           1.0.9                h2bbff1b_7
libbrotlidec              1.0.9                h2bbff1b_7
libbrotlienc              1.0.9                h2bbff1b_7
libclang                  14.0.6          default_hb5a9fac_1
libclang13                14.0.6          default_h8e68704_1
libdeflate                1.17                 h2bbff1b_0
libffi                    3.4.4                hd77b12b_0
libflang                  5.0.0           h6538335_20180525    conda-forge
libiconv                  1.16                 h2bbff1b_2
liblapack                 3.9.0           5_hd5c7e75_netlib    conda-forge
libpng                    1.6.39               h8cc25b3_0
libpq                     12.15                h906ac69_1
libtiff                   4.5.1                hd77b12b_0
libwebp                   1.2.4                hbc33d0d_1
libwebp-base              1.2.4                h2bbff1b_1
libxml2                   2.10.4               h0ad7f3c_1
libxslt                   1.1.37               h2bbff1b_1
llvm-meta                 5.0.0                         0    conda-forge
lz4-c                     1.9.4                h2bbff1b_0
m2w64-gcc-libgfortran     5.3.0                         6
m2w64-gcc-libs            5.3.0                         7
m2w64-gcc-libs-core       5.3.0                         7
m2w64-gmp                 6.1.0                         2
m2w64-libwinpthread-git   5.0.0.4634.697f757               2
matplotlib                3.7.1           py311haa95532_1
matplotlib-base           3.7.1           py311hf62ec03_1
metis                     5.1.0                h6538335_4
mkl                       2023.1.0         h6b88ed4_46357
mkl-service               2.4.0           py311h2bbff1b_1
mkl_fft                   1.3.6           py311hf62ec03_1
mkl_random                1.2.2           py311hf62ec03_1
msys2-conda-epoch         20160418                      1
mumps-seq                 5.2.1               hb3f9cae_11    conda-forge
munkres                   1.1.4                      py_0
networkx                  3.1             py311haa95532_0
numpy                     1.25.2          py311hdab7c0b_0
numpy-base                1.25.2          py311hd01c5d8_0
openmp                    5.0.0                    vc14_1    conda-forge
openssl                   3.0.10               h2bbff1b_2
packaging                 23.1            py311haa95532_0
pcre                      8.45                 hd77b12b_0
pillow                    9.4.0           py311hd77b12b_0
pip                       23.2.1          py311haa95532_0
pluggy                    1.0.0           py311haa95532_1
ply                       3.11            py311haa95532_0
polytope                  0.2.4              pyhd8ed1ab_0    conda-forge
pyparsing                 3.0.9           py311haa95532_0
pyqt                      5.15.7          py311hd77b12b_0
pyqt5-sip                 12.11.0         py311hd77b12b_0
pytest                    7.4.0           py311haa95532_0
python                    3.11.4               he1021f5_0
python-dateutil           2.8.2              pyhd3eb1b0_0
python_abi                3.11                    2_cp311    conda-forge
qt-main                   5.15.2               h879a1e9_9
qt-webengine              5.15.9               h5bd16bc_7
qtwebkit                  5.212                h2bbfb41_5
scipy                     1.11.1          py311hc1ccb85_0
setuptools                68.0.0          py311haa95532_0
sip                       6.6.2           py311hd77b12b_0
six                       1.16.0             pyhd3eb1b0_1
sqlite                    3.41.2               h2bbff1b_0
tbb                       2021.8.0             h59b6b97_0
tk                        8.6.12               h2bbff1b_0
toml                      0.10.2             pyhd3eb1b0_0
tornado                   6.3.2           py311h2bbff1b_0
tqdm                      4.65.0          py311h746a85d_0
tzdata                    2023c                h04d1e81_0
ucrt                      10.0.20348.0         haa95532_0
vc                        14.2                 h21ff451_1
vc14_runtime              14.36.32532         hfdfe4a8_17    conda-forge
vs2015_runtime            14.36.32532         h05e6639_17    conda-forge
wheel                     0.38.4          py311haa95532_0
xz                        5.4.2                h8cc25b3_0
zlib                      1.2.13               h8cc25b3_0
zstd                      1.5.5                hd43e919_0

Environment info

(opyrability-env_5) C:\Users\vc00004>conda info

     active environment : opyrability-env_5
    active env location : C:\Users\vc00004\Anaconda3\envs\opyrability-env_5
            shell level : 2
       user config file : C:\Users\vc00004\.condarc
 populated config files : C:\Users\vc00004\.condarc
          conda version : 23.7.3
    conda-build version : 3.26.1
         python version : 3.9.17.final.0
       virtual packages : __archspec=1=x86_64
                          __win=0=0
       base environment : C:\Users\vc00004\Anaconda3  (writable)
      conda av data dir : C:\Users\vc00004\Anaconda3\etc\conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\Users\vc00004\Anaconda3\pkgs
                          C:\Users\vc00004\.conda\pkgs
                          C:\Users\vc00004\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\vc00004\Anaconda3\envs
                          C:\Users\vc00004\.conda\envs
                          C:\Users\vc00004\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/23.7.3 requests/2.31.0 CPython/3.9.17 Windows/10 Windows/10.0.19045
          administrator : False
             netrc file : None
           offline mode : False
victoraalves commented 10 months ago

After digging a bit and eventually trying the procedure on WSL, it worked.

Perhaps the problem might be Windows-related? JAX native support on windows is relatively new with CPU support only. In addition, by inspecting jaxlib on conda-forge I can see that there are no windows-compatible versions.

traversaro commented 1 month ago

Yes, at the moment there are no jaxlib package on Windows for conda-forge, see https://github.com/conda-forge/jaxlib-feedstock/issues/161 for the main issue tracking this.

The error was a bit more confused by the fact that the environment contained both conda-forge and defaults channels, that in general are not mutually compatible.

As there is already https://github.com/conda-forge/jaxlib-feedstock/issues/161 for adding Windows support, do you think it make sense that we can close this issue? Thanks!

victoraalves commented 1 month ago

Hi @traversaro thanks for the reply. I'll close the issue since you pointed that this is already being tracked. Thanks for clarifying!