1

Currently started to learn TFQ and been trying to do this tutorial of tensorflow authors, but if I run the first line (!pip install -q tensorflow==2.3.1 --user) I get this error:

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. cirq 0.8.0 requires protobuf==3.8.0, but you have protobuf 3.15.7 which is incompatible.

And when I run the second line (!pip install -q tensorflow-quantum --user) I get this one:

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. tensorflow 2.3.1 requires protobuf>=3.9.2, but you have protobuf 3.8.0 which is incompatible.

Cirq 0.8.0 wants protobuf 3.8.0; tensorflow 2.3.1 wants protobuf>=3.9.2 and there is nothing in between and when I do "pip freeze", I only see protobuf==3.8.0, so my pip freeze doesn't see the protobuf 3.15.7 version that the error mentions of (when I do "pip show protobuf" i get the same result of version 3.8.0).

What should I do to prevent this conflict?

Note: Python version = 3.7.9 (couldn't install tf and/or tfq with either 3.8 nor 3.9); OS = Windows 10

Adam Zalcman
  • 26,643
  • 4
  • 71
  • 92
Mina
  • 11
  • 1
  • 2
  • To avoid the conflict use virtual environment to install Tensorflow and Cirq. Since both packages use different versions of protobuf. Thanks! –  Apr 16 '21 at 11:15

1 Answers1

1

Installing two different packages on same environment overrides most of the other. This is the way pip works.It is recommended to use virtual environment for each package.

python -m tf_nightly --system-site-packages .\venv
.\venv\Scripts\activate
pip install --upgrade pip
pip install tf-nightly