I tried to install tensorflow from here
But it fails with the following errors:
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-cpu-aws 2.10.0 requires protobuf<3.20,>=3.9.2, but you have protobuf 4.21.9 which is incompatible.
tensorboard 2.10.1 requires protobuf<3.20,>=3.9.2, but you have protobuf 4.21.9 which is incompatible.
When I try to import tensorflow I get:
import tensorflow
Traceback (most recent call last):
File “”, line 1, in
File “/home/aerolane/.local/lib/python3.8/site-packages/tensorflow/init.py”, line 37, in
from tensorflow.python.tools import module_util as _module_util
File “/home/aerolane/.local/lib/python3.8/site-packages/tensorflow/python/init.py”, line 37, in
from tensorflow.python.eager import context
File “/home/aerolane/.local/lib/python3.8/site-packages/tensorflow/python/eager/context.py”, line 29, in
from tensorflow.core.framework import function_pb2
File “/home/aerolane/.local/lib/python3.8/site-packages/tensorflow/core/framework/function_pb2.py”, line 16, in
from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2
File “/home/aerolane/.local/lib/python3.8/site-packages/tensorflow/core/framework/attr_value_pb2.py”, line 16, in
from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2
File “/home/aerolane/.local/lib/python3.8/site-packages/tensorflow/core/framework/tensor_pb2.py”, line 16, in
from tensorflow.core.framework import resource_handle_pb2 as tensorflow_dot_core_dot_framework_dot_resource__handle__pb2
File “/home/aerolane/.local/lib/python3.8/site-packages/tensorflow/core/framework/resource_handle_pb2.py”, line 16, in
from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2
File “/home/aerolane/.local/lib/python3.8/site-packages/tensorflow/core/framework/tensor_shape_pb2.py”, line 36, in
_descriptor.FieldDescriptor(
File “/home/aerolane/.local/lib/python3.8/site-packages/google/protobuf/descriptor.py”, line 560, in new
_message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
- Downgrade the protobuf package to 3.20.x or lower.
- Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
More information: Changes announced May 6, 2022 | Protocol Buffers Documentation
Downgrading protobuf to 3.19.6 does not help.