当python指向python3时,Google云sdk无法正常工作

Ada*_*Liu 2 python linux google-app-engine google-cloud-platform google-cloud-sdk

我目前正在尝试在我的macbook上安装google cloud sdk.我正在使用scikit-learn和anaconda进行机器学习,所以我的笔记本电脑python指向python3.5.但是google cloud sdk需要安装python 2.7,这就是我面临无法安装它的问题.

当我运行install.sh文件时发生错误,我不知道如何处理它:

Adam | ~ $ git/google-cloud-sdk/install.sh
Welcome to the Google Cloud SDK!
Traceback (most recent call last):
  File "/Users/AdamLiu/Git/google-cloud-sdk/lib/third_party/enum/__init__.py", line 364, in __getattr__
    return cls._member_map_[name]
KeyError: '_convert'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/AdamLiu/git/google-cloud-sdk/bin/bootstrapping/install.py", line 8, in <module>
    import bootstrapping
  File "/Users/AdamLiu/Git/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 9, in <module>
    import setup
  File "/Users/AdamLiu/Git/google-cloud-sdk/bin/bootstrapping/setup.py", line 34, in <module>
    from googlecloudsdk.core.util import platforms
  File "/Users/AdamLiu/Git/google-cloud-sdk/lib/googlecloudsdk/core/util/platforms.py", line 18, in <module>
    import platform
  File "/Users/AdamLiu/anaconda/lib/python3.5/platform.py", line 117, in <module>
    import sys, os, re, subprocess
  File "/Users/AdamLiu/anaconda/lib/python3.5/subprocess.py", line 364, in <module>
    import signal
  File "/Users/AdamLiu/anaconda/lib/python3.5/signal.py", line 8, in <module>
    _IntEnum._convert(
  File "/Users/AdamLiu/Git/google-cloud-sdk/lib/third_party/enum/__init__.py", line 366, in __getattr__
    raise AttributeError(name)
AttributeError: _convert
Run Code Online (Sandbox Code Playgroud)

提前超级谢谢!

jar*_*mod 9

在运行install.sh之前,将CLOUDSDK_PYTHON环境变量设置为Python 2.x可执行文件的位置.

或者确保你的路径中有python2,以便which python2找到它.