我之前已经运行过Credential Management Server。当我今天试着让它运行时,我得到一个错误,说Python3不受支持:-ERROR: Python 3 and later is not compatible with the Google Cloud SDK.
Please use Python version 2.7.x.
If you have a compatible Python interpreter installed, you can use it by setting
the CLOUDSDK_PYTHON environment variable to point to it.
所以我输入了以下命令:
^{pr2}$
重新构建环境并重新启动服务器。现在,当我试图访问服务器时,我发现python3版本的“print”出现了一个错误。在
问题1。Google云Shell Python example是否只与Python3兼容
问题2。我能让python3版本在这种环境下正确运行吗ERROR 2018-10-01 04:36:24,384 wsgi.py:263]
Traceback (most recent call last):
File "/google/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/google/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler
handler, path, err = LoadObject(self._handler)
File "/google/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 85, in LoadObject
obj = __import__(path[0])
File "/home/maherrj/credential-management-api/working/main.py", line 28, in
from oauth2client import client
File "/home/maherrj/credential-management-api/working/lib/oauth2client/client.py", line 39, in
from oauth2client import transport
File "/home/maherrj/credential-management-api/working/lib/oauth2client/transport.py", line 17, in
import httplib2
File "/home/maherrj/credential-management-api/working/lib/httplib2/__init__.py", line 382
print('%s:' % h, end=' ', file=self._fp)
^
SyntaxError: invalid syntax