conda-forge / cirq-feedstock

A conda-smithy repository for cirq.
BSD 3-Clause "New" or "Revised" License
0 stars 4 forks source link

cannot install cirq #10

Closed tpdownes closed 1 year ago

tpdownes commented 2 years ago

Solution to issue cannot be found in the documentation.

Issue

The cirq package cannot be installed in a plain test environment.

$ conda create -n test python=3.9
$ conda activate test
$ conda install cirq
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
Note that strict channel priority may have removed packages required for satisfiability.

My condarc:

$ cat ~/.condarc
channels:
  - conda-forge
channel_priority: strict
changeps1: false
auto_activate_base: false
default_threads: 3
# extra_safety_checks: True
create_default_packages:
  - coreutils

Installed packages

# Name                    Version                   Build  Channel
bzip2                     1.0.8                h0d85af4_4    conda-forge
ca-certificates           2022.6.15            h033912b_0    conda-forge
coreutils                 9.1                  h5eb16cf_0    conda-forge
libffi                    3.4.2                h0d85af4_5    conda-forge
libsqlite                 3.39.2               h5a3d3bf_1    conda-forge
libzlib                   1.2.12               hfe4f2af_2    conda-forge
ncurses                   6.3                  h96cf925_1    conda-forge
openssl                   3.0.5                hb81d4ab_1    conda-forge
pip                       22.2.2             pyhd8ed1ab_0    conda-forge
python                    3.9.13          hf8d34f4_0_cpython    conda-forge
readline                  8.1.2                h3899abd_0    conda-forge
setuptools                65.3.0             pyhd8ed1ab_1    conda-forge
sqlite                    3.39.2               hd9f0692_1    conda-forge
tk                        8.6.12               h5dbffcc_0    conda-forge
tzdata                    2022c                h191b570_0    conda-forge
wheel                     0.37.1             pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h775f41a_0    conda-forge

Environment info

active environment : test
    active env location : /Users/tpdownes/local/miniconda3/envs/test
            shell level : 2
       user config file : /Users/tpdownes/.condarc
 populated config files : /Users/tpdownes/local/miniconda3/.condarc
                          /Users/tpdownes/.condarc
          conda version : 4.14.0
    conda-build version : not installed
         python version : 3.10.6.final.0
       virtual packages : __osx=12.5.1=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /Users/tpdownes/local/miniconda3  (writable)
      conda av data dir : /Users/tpdownes/local/miniconda3/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/osx-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /Users/tpdownes/local/miniconda3/pkgs
                          /Users/tpdownes/.conda/pkgs
       envs directories : /Users/tpdownes/local/miniconda3/envs
                          /Users/tpdownes/.conda/envs
               platform : osx-64
             user-agent : conda/4.14.0 requests/2.28.1 CPython/3.10.6 Darwin/21.6.0 OSX/12.5.1
                UID:GID : 828971:89939
             netrc file : None
           offline mode : False
tpdownes commented 2 years ago

I have tried adding the defaults channel but it has no impact.

BastianZim commented 2 years ago

Can you please post the full output of this:

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
Note that strict channel priority may have removed packages required for satisfiability.

I need to know which packages are incompatible.

tpdownes commented 2 years ago

That is the full output. conda is notoriously unhelpful about package conflicts. You might look at mamba as a tool which may be faster/better/more useful.

tpdownes commented 2 years ago

A potential simple explanation is that I am on macOS but both cirq and cirq-core appear to be noarch.

BastianZim commented 2 years ago

Hmm weird. Can you please run it again with mamba then? Its output should be more helpful.

tpdownes commented 2 years ago

Have you tried replicating my report?

BastianZim commented 2 years ago

Yes not getting the error.

BastianZim commented 2 years ago

Ok was able to verify this in a virtual box. The error produced by mamba is nothing provides h2 3.* needed by httpcore-0.11.1-py_0.

Please file an issue in either of these feedstocks as this is not related to the cirq distribution.

BastianZim commented 2 years ago

Do note, though, that this kind of error can also mean that the package is simply not available, in which case you can either add a PR to the feedstock to add it directly or ask there if they can help you submit it.

tpdownes commented 2 years ago

Well, it's a warning sign that this wasn't detected in the automated builds of cirq.

I think the issue is that the httpcore conda package inaccurately claims that h2==3.* is required (vs "extra"). pip install cirq does not install h2.

On top of that:

Could you show me what package is actually depending upon httpcore?

BastianZim commented 2 years ago

Well, it's a warning sign that this wasn't detected in the automated builds of cirq.

The CI just tests that the package can be installed under our newest supported version. As I said, this is not a bug but just a missing combination of OS, Python version and cirq version.

I think the issue is that the httpcore conda package inaccurately claims that h2==3.* is required (vs "extra"). pip install cirq does not install h2.

That could be. In that case, please file an issue in their feedstocks, as this one manages only the cirq recipe.

Could you show me what package is actually depending upon httpcore?

Cirq-rigetti 0.15. Your solver cannot solve your installation of v1 as that fails with nothing provides msgpack-python >=0.6,<1.0 needed by rpcq-3.10.0-pyhd8ed1ab_0, downgrades to a lower version and fails there as well.

Ref: https://github.com/quantumlib/Cirq/blob/v0.15.0/cirq-rigetti/requirements.txt

tpdownes commented 2 years ago

I appreciate that there are problems downstream of this repo. At the same time, there are presently 4 supported releases of Python on conda-forge: 3.7-3.10. Very soon that will be 3.8-3.11. The evidence above and below suggests to me that this package only works on the soon-to-be oldest release of Python on conda-forge.

$ conda create -n test310 python=3.10
$ conda activate test310
$ conda install cirq
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
Note that strict channel priority may have removed packages required for satisfiability.
$ conda create -n test38 python=3.8
$ conda activate test38
$ conda install cirq
# goes on to succeed because h2==3.2.0 is built for 3.8

I am able to understand the problem downstream, but there is a problem with how conda-forge is testing this package if the automated checks are not actually catching whether it can be installed on the 2 most recent (and supported) releases of Python.

BastianZim commented 2 years ago

Yes and no. These supported python ranges are only for compilation and indicate where it can be compiled but not necessarily where it should be. For noarch packages, this is different. Also, supported does not mean that it will actually work on these versions if there are version constraints, something is not available for a specific OS, etc. If you run the commands on Linux it should give you a different output. As we are entirely volunteer-run, conda-forge strives to include most possibilities but if something is missing, the person needing it should add it ideally themselves.

I am able to understand the problem downstream, but there is a problem with how conda-forge is testing this package if the automated checks are not actually catching whether it can be installed on the 2 most recent (and supported) releases of Python.

No, because of the mentioned above. We do not test all supported versions for packages that are noarch, only for compiled ones as the constraint is that something is not available for a platform, not that the package is broken there.