使用curl https://sdk.cloud.google.com | bash
安装google cloud SDK后,我遇到了仍无法识别gloud命令的问题。因此gcloud init
无法初始化SDK。
我尝试删除“google-cloud-sdk”文件夹进行新安装,但我的终端现在每次打开时都会打印错误。错误是:
user/google-cloud-sdk/exec -l /bin/bash/google-cloud-sdk/path.bash.inc: No such file or directory
和
user/.bash_profile: line 7: syntax error near unexpected token `fi'
-bash: /User/.bash_profile: line 7: `fi
有些东西显然与之前的安装相差无几,但由于gcloud命令仍未被识别,我无法使用任何glcoud命令进行卸载。
如果我遗漏了任何有用的信息,请告诉我。
答案 0 :(得分:1)
所以我发现.bash_profile来自Python 3.5文件夹中的“Update Shell Profile”命令。这是当Google SDK询问您是否要修改命令完成路径时写入的文件。删除此文件中引用SDK的路径可以解决问题。