Cirq icon indicating copy to clipboard operation
Cirq copied to clipboard

Generating lockfile via pip-compile fails with conflicting protobuf requirement

Open rht opened this issue 3 years ago • 2 comments

Description of the issue

When generating a lockfile via pip-compile (https://github.com/jazzband/pip-tools) in my own Python package that lists Cirq as a dependency, I got this error

Could not find a version that matches protobuf<4,<4.0.0dev,<5.0.0dev,>=3.15.0,>=3.19.0,>=3.20.1,>=4.21.3 (from cirq-google==1.0.0->cirq==1.0.0->my-package (pyproject.toml))

It looks like cirq and cirq-google have conflicting protobuf requirement.

How to reproduce the issue

As described above. Here is my command

pip-compile -o requirements.lock pyproject.toml

Cirq version

1.0.0

rht avatar Oct 07 '22 11:10 rht

pip install cirq works as expected; also pip install cirq-google and pip install cirq-core works.

https://github.com/quantumlib/Cirq/search?l=Text&q=protobuf also shows that only cirq-google has a dependency on protobuf.

The above implies that cirq and cirq-google probably don't have a conflicting dependency. Maybe the project that you are compiling for has a conflicting requirement? Maybe you can print the installed packages in your virtual environment using pip freeze ?

tanujkhattar avatar Oct 12 '22 17:10 tanujkhattar

Sorry for not providing a minimal reproducer earlier. Here it is: requirements.txt

cirq==1.0.0

Hence the command is pip-compile -o requirements.lock requirements.txt, ran on a fresh empty virtualenv. pip-compile version: pip-compile, version 6.9.0 (latest release). pip freeze of my fresh virtualenv:

build==0.8.0
click==8.1.3
packaging==21.3
pep517==0.13.0
pip-tools==6.9.0
pyparsing==3.0.9
tomli==2.0.1

pip-compile may have a stricter constraint requirement than just pip install. It is one of the 4 most commonly used way to generate a lockfile (the other being pip freeze you mentioned, and then pipenv, poetry), and so people are likely to encounter this issue in the future.

rht avatar Oct 12 '22 23:10 rht

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days

github-actions[bot] avatar Nov 12 '22 00:11 github-actions[bot]

It seems to be specific to cirq-google

# in cirq-google
$ pip-compile -o requirements.lock requirements.txt 
Could not find a version that matches protobuf!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<4,<4.0.0dev,<5.0.0dev,>=3.15.0,>=3.19.0,>=3.19.5,>=4.21.6 (from -r requirements.txt (line 3))
Tried: 2.0.3, 2.3.0, 2.4.1, 2.5.0, 2.6.0, 2.6.1, 3.0.0, 3.0.0, 3.1.0, 3.1.0.post1, 3.1.0.post1, 3.2.0, 3.2.0, 3.3.0, 3.4.0, 3.4.0, 3.5.0.post1, 3.5.0.post1, 3.5.1, 3.5.1, 3.5.2, 3.5.2, 3.5.2.post1, 3.5.2.post1, 3.6.0, 3.6.0, 3.6.1, 3.6.1, 3.7.0, 3.7.0, 3.7.1, 3.7.1, 3.8.0, 3.8.0, 3.9.0, 3.9.0, 3.9.1, 3.9.1, 3.9.2, 3.9.2, 3.10.0, 3.10.0, 3.11.0, 3.11.0, 3.11.1, 3.11.1, 3.11.2, 3.11.2, 3.11.3, 3.11.3, 3.12.2, 3.12.2, 3.12.4, 3.12.4, 3.13.0, 3.13.0, 3.14.0, 3.14.0, 3.15.0, 3.15.0, 3.15.1, 3.15.1, 3.15.2, 3.15.2, 3.15.3, 3.15.3, 3.15.4, 3.15.4, 3.15.5, 3.15.5, 3.15.6, 3.15.6, 3.15.7, 3.15.7, 3.15.8, 3.15.8, 3.16.0, 3.16.0, 3.17.0, 3.17.0, 3.17.1, 3.17.1, 3.17.2, 3.17.2, 3.17.3, 3.17.3, 3.18.0, 3.18.0, 3.18.1, 3.18.1, 3.18.3, 3.18.3, 3.19.0, 3.19.0, 3.19.0, 3.19.1, 3.19.1, 3.19.1, 3.19.2, 3.19.2, 3.19.2, 3.19.3, 3.19.3, 3.19.3, 3.19.4, 3.19.4, 3.19.4, 3.19.5, 3.19.5, 3.19.5, 3.19.6, 3.19.6, 3.19.6, 3.20.0, 3.20.0, 3.20.0, 3.20.1, 3.20.1, 3.20.1, 3.20.2, 3.20.2, 3.20.2, 3.20.3, 3.20.3, 3.20.3, 4.21.0, 4.21.0, 4.21.0, 4.21.0, 4.21.1, 4.21.1, 4.21.1, 4.21.1, 4.21.2, 4.21.2, 4.21.2, 4.21.2, 4.21.3, 4.21.3, 4.21.3, 4.21.3, 4.21.4, 4.21.4, 4.21.4, 4.21.4, 4.21.5, 4.21.5, 4.21.5, 4.21.5, 4.21.6, 4.21.6, 4.21.6, 4.21.6, 4.21.7, 4.21.7, 4.21.7, 4.21.7, 4.21.8, 4.21.8, 4.21.8, 4.21.8, 4.21.9, 4.21.9, 4.21.9, 4.21.9
Skipped pre-versions: 2.0.0b0, 3.0.0a2, 3.0.0a3, 3.0.0b1, 3.0.0b1.post1, 3.0.0b1.post2, 3.0.0b2, 3.0.0b2, 3.0.0b2.post1, 3.0.0b2.post1, 3.0.0b2.post2, 3.0.0b2.post2, 3.0.0b3, 3.0.0b4, 3.0.0b4, 3.2.0rc1, 3.2.0rc1, 3.2.0rc1.post1, 3.2.0rc1.post1, 3.2.0rc2, 3.2.0rc2, 3.7.0rc2, 3.7.0rc2, 3.7.0rc3, 3.7.0rc3, 3.8.0rc1, 3.8.0rc1, 3.9.0rc1, 3.9.0rc1, 3.10.0rc1, 3.10.0rc1, 3.11.0rc1, 3.11.0rc1, 3.11.0rc2, 3.11.0rc2, 3.13.0rc3, 3.13.0rc3, 3.14.0rc1, 3.14.0rc1, 3.14.0rc2, 3.14.0rc2, 3.14.0rc3, 3.14.0rc3, 3.15.0rc1, 3.15.0rc1, 3.15.0rc2, 3.15.0rc2, 3.16.0rc1, 3.16.0rc1, 3.16.0rc2, 3.16.0rc2, 3.17.0rc1, 3.17.0rc1, 3.17.0rc2, 3.17.0rc2, 3.18.0rc1, 3.18.0rc1, 3.18.0rc2, 3.18.0rc2, 3.19.0rc1, 3.19.0rc1, 3.19.0rc1, 3.19.0rc2, 3.19.0rc2, 3.19.0rc2, 3.20.0rc1, 3.20.0rc1, 3.20.0rc1, 3.20.0rc2, 3.20.0rc2, 3.20.0rc2, 3.20.1rc1, 3.20.1rc1, 3.20.1rc1, 4.0.0rc1, 4.0.0rc1, 4.0.0rc2, 4.0.0rc2, 4.21.0rc1, 4.21.0rc1, 4.21.0rc1, 4.21.0rc1, 4.21.0rc2, 4.21.0rc2, 4.21.0rc2, 4.21.0rc2
There are incompatible versions in the resolved dependencies:
  protobuf<4,>=3.15.0 (from -r requirements.txt (line 3))
  protobuf>=4.21.6 (from grpcio-status==1.50.0->google-api-core[grpc]==1.33.2->-r requirements.txt (line 1))
  protobuf<5.0.0dev,>=3.19.0 (from proto-plus==1.22.1->-r requirements.txt (line 2))
  protobuf<5.0.0dev,>=3.15.0 (from googleapis-common-protos==1.56.4->google-api-core[grpc]==1.33.2->-r requirements.txt (line 1))
  protobuf!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<4.0.0dev,>=3.19.5 (from google-api-core[grpc]==1.33.2->-r requirements.txt (line 1))

rht avatar Nov 12 '22 02:11 rht

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days

github-actions[bot] avatar Dec 14 '22 00:12 github-actions[bot]

Issue closed due to inactivity.

github-actions[bot] avatar Jan 13 '23 00:01 github-actions[bot]