我尝试了SQLAlchemy 中的建议可以与 Google Cloud SQL 一起使用吗?使用 sqlalchemy 建立与谷歌云 sql 的外部连接。
为了让 google appengine 包在我的环境中可见,在安装 google appengine sdk 后,我将 google 目录复制到 site-packages 并创建了一个 google.pth 文件,其中包含带有“./google”的单行。然后可以看到谷歌包。
当我尝试执行 create_engine 调用时,出现以下异常。我的安装中缺少什么吗?我该如何纠正?
create_engine('mysql+gaerdbms:///runningdb', connect_args={"fsrcrunning":"fsrcrunningdb"})
C:\Python27\lib\site-packages\sqlalchemy-0.8.0-py2.7-win32.egg\sqlalchemy\engine\__init__.pyc in create_engine(*args, **kwargs)
330 strategy = kwargs.pop('strategy', default_strategy)
331 strategy = strategies.strategies[strategy]
--> 332 return strategy.create(*args, **kwargs)
333
334
C:\Python27\lib\site-packages\sqlalchemy-0.8.0-py2.7-win32.egg\sqlalchemy\engine\strategies.pyc in create(self, name_or_url, **kwargs)
62 if k in kwargs:
63 dbapi_args[k] = kwargs.pop(k)
---> 64 dbapi = dialect_cls.dbapi(**dbapi_args)
65
66 dialect_args['dbapi'] = dbapi
C:\Python27\lib\site-packages\sqlalchemy-0.8.0-py2.7-win32.egg\sqlalchemy\dialects\mysql\gaerdbms.pyc in dbapi(cls)
48 return rdbms_apiproxy
49 else:
---> 50 from google.storage.speckle.python.api import rdbms_googleapi
51 return rdbms_googleapi
52
C:\Python27\lib\site-packages\google\storage\speckle\python\api\rdbms_googleapi.py in <module>()
44 'PYTHONPATH when using this backend.')
45
---> 46 from apiclient import errors
47 from apiclient import http
48 from apiclient import model
ImportError: No module named apiclient