pip uninstall protobuf pip install protobuf==3.20.1 按照报错要求执行以上命令, 参考连接 TypeError: Descriptors cannot not be created directly. If this call came from a _pb2.py file……_Xavier Jiezou的博客-CSDN博客