获取TypeError:“描述符无法直接安装”运行MediaPipe时

发布于 2025-02-03 20:01:00 字数 316 浏览 4 评论 0原文

我正在尝试使用MediaPipe运行一个脚本,但是我遇到了此错误:TypeError:“不能直接安装描述符”,

如果此调用来自_pb2.py文件,您生成的代码已过时,必须使用Protoc&gt重新生成; = 3.19.0。

如果您无法立即再生纯种,那么其他一些可能的解决方法是:

  1. 将Protobuf软件包降级到3.20.x或更低。
  2. set protocol_buffers_python_implementation = python(但这将使用纯Python解析,并且会慢得多)。

我目前的Python版本是3.7

I am trying to run a script using mediapipe but I am getting this error: TypeError:"Descriptors cannot be installed 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).

My Current Version of python is 3.7

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

慕巷 2025-02-10 20:01:00

至少目前,解决方案正在错误消息中:

将Protobuf软件包降级到3.20.x或更低。

因此

protobuf==3.20.0

The solution, at least for now, is in the error message:

Downgrade the protobuf package to 3.20.x or lower.

So add a pinned requirement to protobuf in your requirements.txt:

protobuf==3.20.0
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文