无法通过gcloud安装

时间:2016-10-16 00:08:25

标签: google-app-engine gcloud google-app-engine-python

我按照以下说明安装了gcloud: https://cloud.google.com/sdk/docs/quickstart-debian-ubuntu

gcloud位于/usr/bin/gcloud的路径中,但我的路径中的包似乎没有dev_appserver.py。它安装了吗?我怎么运行它?

平台:Ubuntu 16.04

修改:运行dpkg -L google-cloud-sdk我已在/usr/lib/google-cloud-sdk/bin/dev_appserver.py找到它,但当我尝试运行它时,我得到:

This action requires the installation of components: [app-engine- python] You cannot perform this action because this Cloud SDK installation is managed by an external package manager. If you would like to get the

也不确定为什么它没有添加到我的路径中。

2 个答案:

答案 0 :(得分:6)

我知道最初的问题与Ubuntu有关,但我只想分享一些macOS / OS X的注释,以防它对其他人有帮助。

我通过Homebrew-Cask安装了google-cloud-sdk并忽略了caveats note

brew cask install google-cloud-sdk

安装SDK cask后,我安装了Python App Engine组件,正如@Rodney Jonace所说:

gcloud components install -q app-engine-python

回到上面提到的警告说明,我在~/.zshrc文件中添加了以下内容:

source $(brew --prefix)/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc
source $(brew --prefix)/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc

打开一个新的终端选项卡,我能够调用额外的Python App Engine脚本(例如dev_appserver.py)并使用Zsh完成。希望有所帮助!

以下文章也很有用:

http://www.javatronic.fr/tips/2014/10/17/installing_google_cloud_sdk_on_ubuntu_with_oh-my-zsh.html

http://www.rainbowbreeze.it/how-to-setup-a-google-app-engine-python-environment-on-mac-osx-using-homebrew/

答案 1 :(得分:3)

google-cloud-sdk deb软件包附带built-in component manager已禁用,这会阻止dev_appserver.py的副本通过gcloud工作。如果您更新apt-cache,则可以安装刚刚开始发布的google-cloud-sdk-app-engine-python和/或google-cloud-sdk-app-engine-java个包。这里的方向:

https://cloud.google.com/sdk/downloads#apt-get