gpt4 book ai didi

macos - 在 Mac OS X 10.6 上使用带有 Python 2.7 的 Google App Engine SDK

转载 作者:太空宇宙 更新时间:2023-11-03 15:18:24 27 4
gpt4 key购买 nike

我需要在安装了 Python 2.6 的 Mac Snow Leopard 上运行 Python 2.7。根据this answer ,从 Python.org 运行 Python 2.7 mpkg 安装程序应该能让我到达那里。

我需要这样做的原因是我正在尝试为 Python 2.7 运行时运行 Google App Engine SDK。

安装 Python 2.7 后,我的 GAE 服务器日志中仍然收到以下警告:

Warning: You are using a Python runtime (2.6) that is older than the production runtime environment (2.7).

我还必须做什么才能让 GAE SDK 识别新的 Python 版本?

编辑 2:

运行:

$ sudo find / -name python2.7

我得到:

/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
/usr/local/bin/python2.7

根据答案,我进入了 GoogleAppLauncher -> Preferences 并为其中的每一个设置了 Python 路径,每次我都得到完全相同的错误。

Running dev_appserver with the following flags: --admin_console_server= --port=8081 Python command: /Library/Frameworks/Python.framework/Versions/2.7 2011-11-14 16:12:24.726 GoogleAppEngineLauncher[57590:203] *** NSTask: Task create for path '/Library/Frameworks/Python.framework/Versions/2.7' failed: 22, "Invalid argument". Terminating temporary process.

另一个奇怪的事情是,无论我插入哪一个,它总是试图解析到相同的路径;它总是恢复到 /Library/Frameworks/Python.framework/Versions/2.7

编辑 3:

好吧,在反复将路径输入 prefs 字段后,我终于把它清除了,不知何故它现在指向了正确的位置:

Running dev_appserver with the following flags:
--admin_console_server= --port=8081
Python command: /usr/local/bin/python2.7

最佳答案

打开 GAE 启动器首选项并将 Python 路径 选项设置为全新安装的 Python 2.7,在您的例子中为 /usr/local/bin/python2.7

关于macos - 在 Mac OS X 10.6 上使用带有 Python 2.7 的 Google App Engine SDK,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8127696/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com