谷歌云shell能运行Python3吗
我以前有过跑步的经历。当我今天尝试运行它时,我得到一个错误,说Python3不受支持:-谷歌云shell能运行Python3吗,python,google-cloud-platform,google-signin,google-oauth,Python,Google Cloud Platform,Google Signin,Google Oauth,我以前有过跑步的经历。当我今天尝试运行它时,我得到一个错误,说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_PYTHO
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.
因此,我输入了以下命令:-
export CLOUDSDK_PYTHON=/usr/bin/python
重新构建环境并重新启动服务器。现在,当我尝试访问服务器时,看起来我在Python3版本的“print”上遇到了一个错误
问题1。Google Cloud Shell Python示例是否仅与Python3兼容
问题2。我可以让Python 3版本在这种环境下正确运行吗
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 <module>
from oauth2client import client
File "/home/maherrj/credential-management-api/working/lib/oauth2client/client.py", line 39, in <module>
from oauth2client import transport
File "/home/maherrj/credential-management-api/working/lib/oauth2client/transport.py", line 17, in <module>
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
错误2018-10-01 04:36:24384 wsgi.py:263]
回溯(最近一次呼叫最后一次):
文件“/google/google cloud sdk/platform/google_appengine/google/appengine/runtime/wsgi.py”,第240行,在Handle中
handler=\u config\u handle.add\u wsgi\u中间件(self.\u LoadHandler())
文件“/google/google cloud sdk/platform/google\u appengine/google/appengine/runtime/wsgi.py”,第299行,在\u LoadHandler中
处理程序,路径,err=LoadObject(self.\u处理程序)
LoadObject第85行的文件“/google/google云sdk/platform/google_appengine/google/appengine/runtime/wsgi.py”
obj=\uuuuuuuuuuuuuu导入(路径[0])
文件“/home/maherrj/credential management api/working/main.py”,第28行,在
从oauth2client导入客户端
文件“/home/maherrj/credential management api/working/lib/oauth2client/client.py”,第39行,在
从oauth2client导入传输
文件“/home/maherrj/credential management api/working/lib/oauth2client/transport.py”,第17行,在
导入httplib2
文件“/home/maherrj/credential management api/working/lib/httplib2/_init__.py”,第382行
打印('%s:'%h,end='',file=self.\u fp)
^
SyntaxError:无效语法
我认为您混淆了一些概念:
- 云壳!=凭证管理API。第一个是,已经安装了一些工具,如Python2、3、Maven等。第二个,顾名思义,是用于管理应用程序中凭据的API李>
- 您提到的代码使用了Python2.7,这可以通过以下几点进行演示。主要的是使用的文件,其中明确提到使用该版本李>