admin管理员组文章数量:1530517
在执行p4_toturials里的一些练习时,在执行第一个测试就出现了问题,首先是提示了如下错误:
Error 1
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:
1. Downgrade the protobuf package to 3.20.x or lower.
2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
根据提示,应该是protoc的版本不对,这里说用版本为3.19.0的prootoc,解决方法如下:
在对应目录下执行
pip install protobuf==3.19.0
这样会自动卸载掉原来的protobuf,重新下载版本为3.19.0的protobuf,我的版本原来是4.21.4,版本过高,根据上面的提示(红色部分)也可以看出,需要降级,所以直接下载3.19.0版本即可。
本文标签: ModuleModuleNotFoundErrorP4toturialtmpnamed
版权声明:本文标题:P4_toturial练习1问题:ModuleNotFoundError: No module named ‘p4.tmp‘ 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dianzi/1725429786a1022772.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论