python – 无法在Amazon Linux上安装gcloud:语法无效

我正在尝试在运行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

知道为什么这会引起问题吗?

我按照谷歌的推荐运行python 2.7(2.7.14).

解决方法:

在“python”命令上安装的python 2.7之上,我还在“python2”命令上安装了python 2.6.
卸载python 2.6解决了这个问题,Google Cloud安装在下次尝试时没有遇到问题.

上一篇:php – require和require-dev之间有什么区别?


下一篇:php – Laravel:刀片文件中的权限被拒绝