I'm seeing the following error when installing TensorFlow:
ImportError: Traceback (most recent call last): File ".../graph_pb2.py", line 6, in from google.protobuf import descriptor as _descriptor ImportError: cannot import name 'descriptor'
This error signals a mismatch between protobuf and TensorFlow versions.
Take the following steps to fix this error:
I faced the similar issue, after trial and error, I used the below logic to run the program:
pip install --upgrade --no-deps --force-reinstall tensorflow
This will make sure to uninstall and reinstall the program from fresh. It works!
I would be extra careful before uninstalling/reinstalling other packages such as protobuf. What I think would most likely be the issue is difference in versions. As of writing this, the most recent release of python is 3.7 while tensorflow is only compatible up to 3.6.
If you're using a 3rd party distribution like Anaconda, this can get hidden from you. In this case I would recommend creating a new environment in Anaconda, with python 3.6 and then installing tensorflow: https://conda.io/projects/conda/en/latest/user-guide/getting-started.html#managing-python
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With