jupyter-server cannot co-habitate with cirq --pre
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.
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.
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
better you check this PR: https://github.com/quantumlib/Cirq/pull/6281