Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cirq and pyzx have incompatible dependencies because of cirq-rigetti #6552

Closed
dlyongemallo opened this issue Apr 9, 2024 · 3 comments
Closed
Labels
kind/bug-report Something doesn't seem to work.

Comments

@dlyongemallo
Copy link
Contributor

dlyongemallo commented Apr 9, 2024

Description of the issue

I am working on the pyzx library for ZX-calculus, and want to use Cirq with it. However, they cannot both be installed into the same environment due to incompatible dependencies, as cirq-rigetti depends on pyquil, which depends on an older version of lark than pyzx does.

I don't think I actually need cirq-rigetti. Is there a workaround that I can use to install cirq while ignoring the requirements for pyquil?

How to reproduce the issue

Create a new virtual environment for Python. Try to install the latest versions of pyzx and cirq.

pip install pyzx==0.8.0 cirq==1.3.0

cirq depends on cirq-rigetti, which depends on pyquil, and the above fails due to rigetti/pyquil#1764.

INFO: pip is looking at multiple versions of cirq-rigetti to determine which version is compatible with other requirements. This could take a while. ERROR: Cannot install cirq-rigetti and pyzx==0.8.0 because these package versions have conflicting dependencies.

The conflict is caused by:
pyzx 0.8.0 depends on lark~=1.1.7
pyquil 3.5.4 depends on lark<0.12.0 and >=0.11.1
pyzx 0.8.0 depends on lark~=1.1.7
pyquil 3.5.3 depends on lark<0.12.0 and >=0.11.1
pyzx 0.8.0 depends on lark~=1.1.7
pyquil 3.5.2 depends on lark<0.12.0 and >=0.11.1
pyzx 0.8.0 depends on lark~=1.1.7
pyquil 3.5.1 depends on lark<0.12.0 and >=0.11.1
pyzx 0.8.0 depends on lark~=1.1.7
pyquil 3.5.0 depends on lark<0.12.0 and >=0.11.1
pyzx 0.8.0 depends on lark~=1.1.7
pyquil 3.4.1 depends on lark<0.12.0 and >=0.11.1
pyzx 0.8.0 depends on lark~=1.1.7
pyquil 3.4.0 depends on lark<0.12.0 and >=0.11.1
pyzx 0.8.0 depends on lark~=1.1.7
pyquil 3.3.5 depends on lark<0.12.0 and >=0.11.1
pyzx 0.8.0 depends on lark~=1.1.7
pyquil 3.3.4 depends on lark<0.12.0 and >=0.11.1
pyzx 0.8.0 depends on lark~=1.1.7
pyquil 3.3.3 depends on lark<0.12.0 and >=0.11.1
pyzx 0.8.0 depends on lark~=1.1.7
pyquil 3.3.2 depends on lark<0.12.0 and >=0.11.1
pyzx 0.8.0 depends on lark~=1.1.7
pyquil 3.3.1 depends on lark<0.12.0 and >=0.11.1
pyzx 0.8.0 depends on lark~=1.1.7
pyquil 3.3.0 depends on lark<0.12.0 and >=0.11.1
pyzx 0.8.0 depends on lark~=1.1.7
pyquil 3.2.1 depends on lark<0.12.0 and >=0.11.1
pyzx 0.8.0 depends on lark~=1.1.7
pyquil 3.2.0 depends on lark<0.12.0 and >=0.11.1

To fix this you could try to:

  1. loosen the range of package versions you've specified
  2. remove package versions to allow pip attempt to solve the dependency conflict

Cirq version
1.3.0

@dlyongemallo dlyongemallo added the kind/bug-report Something doesn't seem to work. label Apr 9, 2024
@maffoo
Copy link
Contributor

maffoo commented Apr 9, 2024

cirq is an umbrella package that installs a number of other packages. You can instead install cirq-core to avoid bringing in all the dependencies of cirq-rigetti and other associated packages (see the cirq-* directories in the repo, which correspond to individual packages). We may need to make some documentation updates to make it clear that installing the full cirq package is generally not necessary.

@dlyongemallo
Copy link
Contributor Author

Okay, I'll use cirq-core and add other cirq-* packages as I need instead of depending on cirq. That got rid of the error. Thanks.

(I'll close the issue, but there's still a conflict between cirq-rigetti and pyzx, if anyone should ever want to use them together.)

@cosenal
Copy link

cosenal commented Apr 10, 2024

There is a PR in progress to upgrade PyQuil to v4 in cirq-rigetti. That should resolve many dependency conflicts and hopefully will be shipped soon 🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug-report Something doesn't seem to work.
Projects
None yet
Development

No branches or pull requests

3 participants