python - 将适用于 Python 的 Google App Engine SDK 与 Python 3 结合使用

标签 python windows python-2.7 python-3.x google-app-engine

我安装了 Python 3.5.2 和 Python 2.7.12(在 Windows 上)。但是,当我尝试从使用适用于 Python 的 Google App Engine SDK 进行部署时,我收到以下错误消息:

in <module>
    run_file(__file__, globals())
  File "C:\Program Files (x86)\Google\google_appengine\appcfg.py", line 129, in run_file
    execfile(_PATHS.script_file(script_name), globals_)
NameError: name 'execfile' is not defined
2016-08-17 11:28:50 (Process exited with code 1)

我只能从命令行部署:

C:\Python27\python.exe "C:\Program Files (x86)\Google\google_appengine\appcfg.py" update app.yaml

有没有办法使用 Python 2 而不是 Python 3 进行部署?不使用命令行?我如何向 Google 报告此错误,我想如果他们愿意,他们可以修复 Google App Engine SDK。

最佳答案

您需要选择正确的Python路径,当您有多个Python副本时,可能会选择错误的路径作为默认路径。
通常它是C:\Python27\pythonw.exe,但是如果您在安装过程中更改了它,它可能是其他东西。
转至 Google App Engine 启动器,然后在“编辑/首选项”中将路径更改为您想要的路径。

关于python - 将适用于 Python 的 Google App Engine SDK 与 Python 3 结合使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38991770/

相关文章:

python - 如何从 sublime 插件中的另一个目录导入类

python - 运行多个python的linux bash脚本

c - 更新队列并从队列中删除所需的内容

Python 线程在 Python 中使用 ctrl-c 退出

python-2.7 - Ansible 无法在 sbin 文件夹上运行 shell 模块

python - 如何知道什么是正确的编码?

python - 给定条件递增前 n 个列表元素

python - 计算类和实例哈希

windows - vscode typescript无法读取未定义的属性 'compilerOptions'

c++ - 快速 RAM 中的动态内存分配