Google App Engine,更改哪个python版本 [英] Google App Engine, Change which python version

查看:115
本文介绍了Google App Engine,更改哪个python版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将GCS客户端库与我的App Engine应用程序一起使用,但遇到了这个问题-

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

为了在应用程序中使用客户端库,请将/src/cloudstorage目录放在sys.path中,以便Python可以找到它."

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

首先,这是否意味着我需要将目录移至我的sys.path中,还是需要将~/src/cloudstorage/添加到我的PATH环境变量中?

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?

第二,当我从App Engine交互式控制台打印sys.versionsys.path时,我看到的是Python版本2.7.2,但是当我从终端(在Mac上)打印时,我得到了Python I想要通过Homebrew使用并安装-2.7.5.控制台中的sys.path显示所有App Engine路径和默认的Python安装-/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7

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

在我的终端上-/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/

我需要帮助来了解如何进行更改.

I need help understanding how to change this.

**更新**

好的,我想出了这个答案的一部分. 为了在应用程序中使用客户端库,请将/src/cloudstorage目录放在sys.path中,以便Python可以找到它."意味着将实际目录移动到App Engine项目目录.

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.

第二部分仍然存在-为什么我的Mac PATH环境变量未在APP Engine中使用.如何更改App Engine使用的Python的默认版本(从2.7.2更改为2.7.5)?这与更改YAML文件中的版本无关.

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.

推荐答案

在GAE中,通过偏好设置"更改python路径,将"Python路径"设置为与您的python 27路径匹配.

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

这篇关于Google App Engine,更改哪个python版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆