目录
问题描述
- python 版本3.5
- macbook在用pip安装tensorflow后由于某些原因用pip又卸载了,然后再次pip install tensorflow,tensorflow安装成功
此时import tensorflow时报错:
KeyError: “Couldn’t find field google.protobuf.DescriptorProto.ExtensionRange.options”
如下图:
解决办法
pip uninstall protobuf
pip install protobuf==3.3.0
两行代码重装protobuf,问题解决
推测是在卸载tensorflow时使得protobuf组件缺失,导致报错