Pennylane install stoped working

Dear pennylane team,
My pennylane installation stoped working after installing D-waves Ocean tools . Please see the traceback below. Could you please help me to resolve this issue?

---------------------------------------------------------------------------
ContextualVersionConflict                 Traceback (most recent call last)
<ipython-input-1-568943143a45> in <module>
      5 import time
      6 
----> 7 import pennylane as qml
      8 from pennylane import numpy as np
      9 from pennylane.operation import Operation

/usr/local/lib/python3.8/site-packages/pennylane/__init__.py in <module>
    130 for entry in pkg_resources.iter_entry_points("pennylane.qchem"):
    131     if entry.name == "OpenFermion":
--> 132         qchem = entry.load()
    133 
    134 

/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py in load(self, require, *args, **kwargs)
   2444             )
   2445         if require:
-> 2446             self.require(*args, **kwargs)
   2447         return self.resolve()
   2448 

/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py in require(self, env, installer)
   2467         # requirements for that extra are purely optional and skip over them.
   2468         reqs = self.dist.requires(self.extras)
-> 2469         items = working_set.resolve(reqs, env, installer, extras=self.extras)
   2470         list(map(working_set.add, items))
   2471 

/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py in resolve(self, requirements, env, installer, replace_conflicting, extras)
    773                 # Oops, the "best" so far conflicts with a dependency
    774                 dependent_req = required_by[req]
--> 775                 raise VersionConflict(dist, req).with_context(dependent_req)
    776 
    777             # push the new requirements onto the stack

ContextualVersionConflict: (protobuf 3.18.0 (/usr/local/lib/python3.8/site-packages), Requirement.parse('protobuf~=3.13.0'), {'cirq'})

I tried reinstalling with pip and it didn’t work.

Hi @Einar_Gabbassov!

It seems from the error message that Cirq is also installed, and this requires a specific version of the protobuf package. However, when you installed the Ocean SDK, this version of protobuf seems to have gotten upgraded. There are potentially two solutions:

You could try downgrading your version of protobuf, and see if that works:

pip install protobuf~=3.13.0 
1 Like