gpt4 book ai didi

google-cloud-platform - 谷歌云平台: ImportError: No module named 'google.api.core' on deploy

转载 作者:行者123 更新时间:2023-12-02 18:00:29 25 4
gpt4 key购买 nike

这是我尝试使用 gcloud app deploy 进行部署时收到的错误。我之前已经成功部署了相同的应用程序。我能够在本地计算机中运行该应用程序,但在部署时收到错误

回溯:

Updating service [default]...failed.                                           
ERROR: (gcloud.app.deploy) Error Response: [9]
Application startup error:
[2017-08-25 10:50:23 +0000] [1] [INFO] Starting gunicorn 19.7.1
[2017-08-25 10:50:23 +0000] [1] [INFO] Listening at: http://0.0.0.0:8080 (1)
[2017-08-25 10:50:23 +0000] [1] [INFO] Using worker: sync
[2017-08-25 10:50:23 +0000] [7] [INFO] Booting worker with pid: 7
[2017-08-25 10:50:23 +0000] [7] [ERROR] Exception in worker process
Traceback (most recent call last):
File "/env/lib/python3.5/site-packages/gunicorn/arbiter.py", line 578, in spawn_worker
worker.init_process()
File "/env/lib/python3.5/site-packages/gunicorn/workers/base.py", line 126, in init_process
self.load_wsgi()
File "/env/lib/python3.5/site-packages/gunicorn/workers/base.py", line 135, in load_wsgi
self.wsgi = self.app.wsgi()
File "/env/lib/python3.5/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/env/lib/python3.5/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
return self.load_wsgiapp()
File "/env/lib/python3.5/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
return util.import_app(self.app_uri)
File "/env/lib/python3.5/site-packages/gunicorn/util.py", line 352, in import_app
__import__(module)
File "/home/vmagent/app/main.py", line 19, in <module>
app = bookshelf.create_app(config)
File "/home/vmagent/app/bookshelf/__init__.py", line 49, in create_app
model = get_model()
File "/home/vmagent/app/bookshelf/__init__.py", line 107, in get_model
from . import model_datastore
File "/home/vmagent/app/bookshelf/model_datastore.py", line 16, in <module>
from google.cloud import datastore
File "/env/lib/python3.5/site-packages/google/cloud/datastore/__init__.py", line 61, in <module>
from google.cloud.datastore.client import Client
File "/env/lib/python3.5/site-packages/google/cloud/datastore/client.py", line 33, in <module>
from google.cloud.datastore.query import Query
File "/env/lib/python3.5/site-packages/google/cloud/datastore/query.py", line 19, in <module>
from google.api.core import page_iterator
ImportError: No module named 'google.api.core'
[2017-08-25 10:50:23 +0000] [7] [INFO] Worker exiting (pid: 7)
[2017-08-25 10:50:24 +0000] [1] [INFO] Shutting down: Master
[2017-08-25 10:50:24 +0000] [1] [INFO] Reason: Worker failed to boot.

最佳答案

tl;dr:将您的 google-cloud 升级到 0.27,它应该可以解决问题。

<小时/>

我认为这是新 google-cloud 依赖项的错误。就我而言,google-cloud==0.25 在其 setup.py 中引入这些依赖项:

 'google-cloud-core >= 0.24.0, < 0.25dev',
'google-cloud-datastore >= 1.0.0, < 2.0dev',

就在最近的 8 月 24 日(提交此问题的前一天),google-cloud-datastore 软件包已更新至 1.3.0

遗憾的是,google-cloud-datastore 1.3.0 依赖于较新版本的 google-cloud-core:

 'google-cloud-core >= 0.27.0, < 0.28dev',

但是使用旧版本的 pip 似乎未解决/未警告此版本控制冲突。但是 google-cloud-datastore 想要 from google.api.core import page_iterator,尽管 google.api.core 并不是这样添加到0.27.0,然后一切都崩溃了。

我相信“bug”存在于 google-cloud===0.25(或者可能是您正在使用的任何版本)中的过载广泛依赖项中。

我相信我们的“修复”方法是升级到最新版本的 google-cloud=0.27

虽然 google-cloud 的“正确修复”是为了改善其版本控制依赖性,但范围不那么广泛,否则可能会破坏与已发布模块的向后兼容性。

关于google-cloud-platform - 谷歌云平台: ImportError: No module named 'google.api.core' on deploy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45880108/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com