python - Adding Google Analytics API Library to Google App Engine -
i trying run simple python script on google app engine. how install google analytics api library?
library: https://developers.google.com/api-client-library/python/apis/analytics/v3
instructions: https://cloud.google.com/appengine/docs/python/tools/libraries27#vendoring
i've tried , can't run, though works on pc. have right is: python scripts in root folder, in /lib folder copied folders installed pc (/googleapiclient , /google_api_python_client-1.4.0-py2.7.egg-info) , have appengine_config.py in /lib folder contains:
from google.appengine.ext import vendor # add libraries installed in "lib" folder. vendor.add('lib') vendor.add('google-api-client')
app.yaml file:
application: psyched-cab-861 version: 1 runtime: python27 api_version: 1 threadsafe: true handlers: - url: /.* script: hello_analytics_api_v3.app
traceback:
traceback (most recent call last): file "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 240, in handle handler = _config_handle.add_wsgi_middleware(self._loadhandler()) file "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 299, in _loadhandler handler, path, err = loadobject(self._handler) file "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 85, in loadobject obj = __import__(path[0]) importerror: no module named helloworld
new log:
traceback (most recent call last): file "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 240, in handle handler = _config_handle.add_wsgi_middleware(self._loadhandler()) file "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/lib_config.py", line 354, in __getattr__ self._update_configs() file "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/lib_config.py", line 290, in _update_configs self._registry.initialize() file "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/lib_config.py", line 165, in initialize import_func(self._modname) file "/base/data/home/apps/s~just-terminus-94303/1.384249106864280829/appengine_config.py", line 5, in <module> vendor.add('google-api-python-client') file "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/vendor/__init__.py", line 44, in add 'no such virtualenv or site directory' % path) valueerror: virtualenv: cannot access google-api-python-client: no such virtualenv or site directory
i tried editing appengine_config.py file
vendor.add('googleapiclient') #the name of file
i edit in gae, , click commit, saves, same error above vendor.add('google-api-python-client') error. why file not updating?
as docs say: put appengine_config.py
in root folder of application (and not in /lib folder). way, name of library google-api-python-client
, not google-api-client
.
then have install google-python-api-client
in /lib folder:
$ pip install -t lib google-api-python-client
Comments
Post a Comment