【问题标题】:ModuleNotFoundError: No module named 'google' over night with no change in codeModuleNotFoundError:夜间没有名为“google”的模块,代码没有变化
【发布时间】:2018-05-16 08:22:21
【问题描述】:

我们的 Python 构建在昨晚没有更改代码时失败。

File "/usr/local/lib/python3.6/site-packages/MY_PACKAGE/MY_FILE_pb2.py", line 6, in <module>
    from google.protobuf import descriptor as _descriptor
ModuleNotFoundError: No module named 'google'

我们对 MY_PACKAGE 的唯一依赖是 grpcio (&gt;=1.9.1)

【问题讨论】:

    标签: python protocol-buffers grpc


    【解决方案1】:

    我刚刚发现原因是从grpcio 最新版本中删除了protobuf 依赖项:

    打包 grpcio 1.11.0 元数据:

    "run_requires": [{"requires": ["six (>=1.5.2)"]}]
    

    打包 grpcio 1.12.0 元数据:

    "run_requires": [{"requires": ["protobuf (>=3.5.0.post1)", "six (>=1.5.2)"]}]
    

    所以需要手动添加protobuf依赖。

    【讨论】:

      猜你喜欢
      • 2019-02-01
      • 2021-07-01
      • 2020-12-02
      • 2021-01-04
      • 1970-01-01
      • 2019-03-28
      • 1970-01-01
      • 2020-09-26
      • 2022-09-25
      相关资源
      最近更新 更多