无法在Amazon Linux上安装gcloud:语法无效 [英] Can't install gcloud on Amazon Linux : invalid syntax
问题描述
我试图在运行以下命令的交互模式下在运行Amazon Linux 4.14.47-56.37 64位的EC2服务器上安装gcloud:
I'm trying to install gcloud on my EC2 server running Amazon Linux 4.14.47-56.37 64bits, in interactive mode running the following command :
curl https://sdk.cloud.google.com | bash
文件已正确下载,但安装失败,并显示以下回溯:
The files download correctly, but the install then fails with the following 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
您知道为什么这会引起问题吗?
Any idea why this for is causing issues?
我正在按照Google的建议运行python 2.7(2.7.14).
I am running python 2.7 (2.7.14) as recommended by Google.
推荐答案
除了在"python"命令上安装的python 2.7之外,我还在"python2"命令上安装了python 2.6. 卸载python 2.6解决了该问题,在下次尝试时Google Cloud安装顺利完成.
On top of python 2.7 installed on the "python" command, I also had python 2.6 installed on the "python2" command. Uninstalling python 2.6 solved the issue, Google Cloud install went through without issue on the next try.
这篇关于无法在Amazon Linux上安装gcloud:语法无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!