Google App Engine, Change which python version

廉价感情. 提交于 2019-12-11 03:53:29

问题


I'm trying to use the GCS client library with my app engine app and I ran into this -

"In order to use the client library in your app, put the /src/cloudstorage directory in your sys.path so Python can find it."

First, does this mean I need to move the directory into my sys.path OR does it need to add the ~/src/cloudstorage/ to my PATH environment variable?

Second, when I print sys.version and sys.path from the App Engine Interactive Console, I see a Python Version of 2.7.2, but when I print from my Terminal (on a Mac), I get the Python I want to use and installed via Homebrew - 2.7.5. The sys.path in the Console shows all App Engine paths and the default Python installation - /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7

On my terminal - /usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/

I need help understanding how to change this.

** UPDATE **

Okay, I figured out part of this answer. "In order to use the client library in your app, put the /src/cloudstorage directory in your sys.path so Python can find it." means moving the actual directory to the App Engine project directory.

The second piece still remains - why is my Mac PATH environment variable not used in APP Engine. How can I change the default version of Python used by the App Engine (from 2.7.2 to 2.7.5)? This is not related to changing the version in the YAML file.


回答1:


In GAE change the python path via Preferences settings, set Python Path to match your python 27 path.



来源:https://stackoverflow.com/questions/18407249/google-app-engine-change-which-python-version

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!