我正在尝试以交互方式运行以下命令在运行Amazon Linux 4.14.47-56.37 64位的EC2服务器上安装gcloud:
curl https://sdk.cloud.google.com | bash
文件正确下载,但是安装失败,并显示以下Traceback:
File "/home/ec2-user/google-cloud-sdk/bin/bootstrapping/install.py", line 12, in <module> import bootstrapping File "/home/ec2-user/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 32, in <module> import setup # pylint:disable=g-import-not-at-top File "/home/ec2-user/google-cloud-sdk/bin/bootstrapping/setup.py", line 55, in <module> from googlecloudsdk.core import properties File "/home/ec2-user/google-cloud-sdk/lib/googlecloudsdk/core/properties.py", line 291 self.__sections = {section.name: section for section in sections} ^ SyntaxError: invalid syntax
知道为什么这会引起问题吗?
我正在按照Google的建议运行python 2.7(2.7.14)。
除了在“ python”命令上安装的python 2.7之外,我还在“ python2”命令上安装了python 2.6。卸载python 2.6解决了该问题,在下次尝试时Google Cloud安装顺利完成。