私のPython仮想環境が原因であることが判明した非常に異なる話がありました。
実行の途中でエラーcurl https://sdk.cloud.google.com | bashが発生しました:
~/google-cloud-sdk/install.sh
Welcome to the Google Cloud SDK!
pyenv: python2: command not found
The `python2' command exists in these Python versions:
2.7.14
miniconda2-latest
google-cloud-sdk/install.shスクリプトを変更したソリューション:
# if CLOUDSDK_PYTHON is empty
if [ -z "$CLOUDSDK_PYTHON" ]; then
# if python2 exists then plain python may point to a version != 2
#if _cloudsdk_which python2 >/dev/null; then
# CLOUDSDK_PYTHON=python2
if _cloudsdk_which python2.7 >/dev/null; then
# this is what some OS X versions call their built-in Python
CLOUDSDK_PYTHON=python2.7
そして、インストールを正常に実行することができました。ただし、python2実行するコマンドがあるpyenvをアクティブにする必要がありますgcloud。
なんでそうなの
あなたが見ればgoogle-cloud-sdk/install.shスクリプト、あなたはそれが実際には非常にブルート方法でのPythonのバージョンをチェックしていますことがわかります。
if [ -z "$CLOUDSDK_PYTHON" ]; then
# if python2 exists then plain python may point to a version != 2
if _cloudsdk_which python2 >/dev/null; then
CLOUDSDK_PYTHON=python2
しかし、私のマシンでpython2はPythonバイナリをポイントしておらず、どちらもnullを返しません。そのため、インストールがクラッシュしました。
.bashrcファイルの更新についてプロンプトを出しますが、zshまたは他のシェルでは(まだ)機能しません。インストーラーでのzshのサポートは現在進行中です。yインストーラーがプロンプトを表示したときに答えましたModify profile to update your $PATH and enable bash completion? (Y/n)?か?