51工具盒子

依楼听风雨
笑看云卷云舒,淡观潮起潮落

执行python3服务时提示ModuleNotFoundError: No module named 'google'

在启动python3服务时,提示缺少google模块

[root@643578633c10 src]# python3 server_start.py 
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/tritonclient/grpc/__init__.py", line 29, in <module>
    from tritonclient.grpc import model_config_pb2
  File "/usr/local/lib/python3.6/site-packages/tritonclient/grpc/model_config_pb2.py", line 5, in <module>
    from google.protobuf.internal import enum_type_wrapper
ModuleNotFoundError: No module named 'google'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File &quot;server_start.py&quot;, line 30, in &lt;module&gt; from routers import ocr_router File &quot;/app/server_ocr/src/routers/ocr_router.py&quot;, line 17, in &lt;module&gt; from modules.service import temp_service, item_request_service File &quot;/app/server_ocr/src/modules/service/item_request_service.py&quot;, line 15, in &lt;module&gt; from modules.response.post_table_model import Table2HTMLPredictor, get_response File &quot;/app/server_ocr/src/modules/response/post_table_model.py&quot;, line 12, in &lt;module&gt; import tritonclient.grpc as grpcclient File &quot;/usr/local/lib/python3.6/site-packages/tritonclient/grpc/init.py&quot;, line 45, in &lt;module&gt; 'package to include the support') from error RuntimeError: The installation does not include grpc support. Specify 'grpc' or 'all' while installing the tritonclient package to include the support


解决办法

python3 -m pip install google-api-python-client
赞(5)
未经允许不得转载:工具盒子 » 执行python3服务时提示ModuleNotFoundError: No module named 'google'