4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Google Cloud SDKをpyenvのpythonでinstallする

Last updated at Posted at 2017-11-01

python2系インストール

python3系でインストールしようとするとエラーになった
仕方ないので、2系をインストール

pyenv install 2.7.10
pyenv global 2.7.10

オプションをつけて実行

指示通りにやるとplatformがないと怒られた

$ ./google-cloud-sdk/install.sh

Welcome to the Google Cloud SDK!
Traceback (most recent call last):
  File "~/Downloads/google-cloud-sdk/bin/bootstrapping/install.py", line 8, in <module>
    import bootstrapping
  File "~/Downloads/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 9, in <module>
    import setup
  File "~/Downloads/google-cloud-sdk/bin/bootstrapping/setup.py", line 27, in <module>
    from googlecloudsdk.core.util import platforms
  File "~/Downloads/google-cloud-sdk/lib/googlecloudsdk/core/util/platforms.py", line 18, in <module>
    import platform
ImportError: No module named platform

なのでオプションをつけて実行

CLOUDSDK_PYTHON_SITEPACKAGES=1 ./install.sh

zshrcの設定

export CLOUDSDK_PYTHON_SITEPACKAGES=1
source 'PATHTO/google-cloud-sdk/path.zsh.inc'
source 'PATHTO/google-cloud-sdk/completion.zsh.inc'
4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?