报错: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.
解决方案:
输入
pip uninstall protobuf将现有版本的卸载,
然后输入
pip install protobuf 3.19.0
pip install protobuf==3.19.0
由于网速会影响成功率,我运行了两次才装成功的。
出错
ERROR: Cannot unpack file C:\Users\Lenovo\AppData\Local\Temp\pip-unpack-bph4anlw\simple.html (downloaded from C:\Users\Lenovo\AppData\Local\Temp\pip-req-build-pbmos7b8, content-type: text/html); cannot detect archive format
ERROR: Cannot determine archive format of C:\Users\Lenovo\AppData\Local\Temp\pip-req-build-pbmos7b8
解决方法:换源 但无果
反复:pip install protobuf==3.19.0
好像行了
报错:
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.
tensorboard 2.12.0 requires protobuf>=3.19.6, but you have protobuf 3.19.0 which is incompatible.
解决:安装3.19.6版本
pip install protobuf==3.19.6
不行,再次报错:
protobuf requires Python '>=3.7' but the running Python is 3.6.0
You are using pip version 9.0.1, however version 23.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
解决方法:先更新pip,即
python -m pip install --upgrade pip做完这一步再重新安装TensorFlow
可以了