Search code examples
pythonpackageanacondacondaversion

anaconda/conda UnsatisfiableError when trying to install pychrono - cannot meet python version specifications


First post. I'm trying to install pychrono (https://projectchrono.org/pychrono/) via these commands in the anaconda prompt (using windows 11).

conda create --name pychrono311 python=3.11
conda activate pychrono311
conda install -c projectchrono pychrono

I get this response:

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 the existing python installation in your environment:

Specifications:

  - pychrono -> python[version='>=3.10,<3.11.0a0|>=3.8,<3.9.0a0|>=3.9,<3.10.0a0']

Your python: python=3.11

If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.

So, based upon the version specs I see, I deactivate and try (what I think) is a python version that's supported:

conda deactivate
conda env remove --name pychrono311
conda create --name pychrono310 python=3.10
conda activate pychrono310
conda install -c projectchrono pychrono

However, I get this response:

...
Specifications:

  - pychrono -> python[version='>=3.11,<3.12.0a0|>=3.12,<3.13.0a0']

Your python: python=3.10

I tried with various other python versions (3.9, 3.8) and it's the same.

What am I missing here? It seems that it's impossible to satisfy the requirements. Am I missing a parameter or more advanced version numbers? The fact that the requirements change is odd as well.


Solution

  • Inspecting the channel configuration when the latest projectchrono::pychrono was built1, I see the following:

    {
      "channels": [
        "https://conda.anaconda.org/intel",
        "https://conda.anaconda.org/conda-forge",
        "https://repo.anaconda.com/pkgs/main",
        "https://conda.anaconda.org/intel",
        "https://conda.anaconda.org/conda-forge",
        "https://conda.anaconda.org/dlr-sc"
      ],...}
    

    Trick about Conda is that one really needs to use the same channel configuration as the package used at build time in order to ensure it works. In this case, this is just easier to express as a YAML (and a better practice, in general):

    pychrono310.yaml

    name: pychrono310
    channels:
      - projectchrono
      - intel
      - conda-forge
      - main
      - dlr-sc
      ## NB: I've dropped the redundant ones
    dependencies:
      ## OP was correct about no Python 3.11 support
      - python=3.10
      - pychrono
    

    This then worked for me in testing:

    conda env create -n pychrono310 -f pychrono310.yaml
    

    [1]: This information is found by downloading a tarball from Anaconda Cloud and inspecting the info/about.json file.