【发布时间】:2018-09-18 06:45:26
【问题描述】:
第一次从 AWS 设置迁移到 GCE,请多多包涵我的幼稚问题。
在./google-cloud-sdk/install.sh这一步的过程中,遇到如下错误:
Welcome to the Google Cloud SDK!
Traceback (most recent call last):
File "/Users/t/Desktop/./google-cloud-sdk/bin/bootstrapping/install.py", line 8, in <module>
import bootstrapping
File "/Users/t/Desktop/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 19, in <module>
from googlecloudsdk.core.credentials import store as c_store
File "/Users/t/Desktop/google-cloud-sdk/lib/googlecloudsdk/core/credentials/store.py", line 34, in <module>
from googlecloudsdk.core.credentials import creds
File "/Users/t/Desktop/google-cloud-sdk/lib/googlecloudsdk/core/credentials/creds.py", line 40, in <module>
import sqlite3
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sqlite3/__init__.py", line 24, in <module>
from dbapi2 import *
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sqlite3/dbapi2.py", line 28, in <module>
from _sqlite3 import *
ImportError: No module named _sqlite3
经过仔细检查,我注意到我的/usr/local/Cellar/python 即有两个 python2.7 版本。 2.7.10_2 和 2.7.11。
奇怪的是,当我转到python命令行时,这个问题:
Python 2.7.10 (default, Oct 6 2017, 22:29:07)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> from _sqlite3 import *
>>> print('hello, this seems to work')
hello, this seems to work
虽然不幸的是install.sh 是从系统中获取py2.7.11 版本而不是python 版本,但我不确定我们是否可以设置一些环境变量,(例如$CLOUDSDK_PYTHON 在我们开始安装之前)。
【问题讨论】:
标签: python-2.7 sqlite google-cloud-platform gcloud google-cloud-sdk