Cirq icon indicating copy to clipboard operation
Cirq copied to clipboard

jupyter-server cannot co-habitate with cirq --pre

Open pavoljuhas opened this issue 1 year ago • 2 comments

Description of the issue

In a fresh virtual environment for Python 3.10

$ pip install jupyter jupyter-server
$ pip install --pre cirq
...
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
jupyter-events 0.9.1 requires jsonschema[format-nongpl]>=4.18.0, but you have jsonschema 4.17.3 which is incompatible.
jupyterlab 4.1.4 requires httpx>=0.25.0, but you have httpx 0.23.3 which is incompatible.
jupyterlab-server 2.25.4 requires jsonschema>=4.18.0, but you have jsonschema 4.17.3 which is incompatible.
referencing 0.33.0 requires attrs>=22.2.0, but you have attrs 21.4.0 which is incompatible.

After this jupyter notebook fails to start with TypeError from the referencing package.

An attempt to install jupyter-server with existing notebook requirements fails to resolve a compatible set of packages:

$ pip install -r dev_tools/requirements/notebooks.env.txt jupyter-server
... 30 minutes of trial resolutions ...
ERROR: Exception
pip._vendor.resolvelib.resolvers.ResolutionTooDeep: 200000

Note: jupyter-server can be installed with cirq-core so the incompatible requirement is in some other cirq-something-not-core package.

Proposed Solution

Update package dependencies so they are compatible with jupyter-server requirements.

Cirq version

1.4.0.dev at dc1065d4c393453cde17e0ae6a2089efa3edef2d.

pavoljuhas avatar Mar 14 '24 00:03 pavoljuhas

Typically we don't install cirq but rather cirq-core, cirq-google, etc to bring in a minimal set of dependencies. I suspect it's one of the other cirq-* packages that is actually causing a problem here.

maffoo avatar Mar 14 '24 01:03 maffoo

I installed the subpackages one by one, it looks like the issue comes from cirq-rigetti which depends on an old version of pyquil<4.0 which has the transitive dependency on old jupyter. pyquil is no at 4.8 so I think changing this line https://github.com/quantumlib/Cirq/blob/0f4822b1ee85373c675222a22040d7f75adc6e60/cirq-rigetti/requirements.txt#L1

to pyquil~4.8.0 should fix the issue

NoureldinYosri avatar Mar 15 '24 20:03 NoureldinYosri

better you check this PR: https://github.com/quantumlib/Cirq/pull/6281

jhgoebbert avatar Jun 02 '24 07:06 jhgoebbert