本文介绍了Google App Engine 是否支持 Python 3?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始学习 Python 3.4 并想开始使用库以及 Google App Engine,但大多数 Python 库仅支持 Python 2.7,与 Google App Engine 相同.

I started learning Python 3.4 and would like to start using libraries as well as Google App Engine, but the majority of Python libraries only support Python 2.7 and the same with Google App Engine.

我应该学习 2.7 还是有更简单的方法?(我的机器上可以同时有 2 个 Python 版本吗?)

Should I learn 2.7 instead or is there an easier way? (Is it possible to have 2 Python versions on my machine at the same time?)

推荐答案

不,没有.

[编者注:截至 2018 年 8 月,此答案已过时;查看评论和其他答案]

Google App Engine (GAE)Python 应用程序使用沙盒化的 Python 2.7 运行时.这是正常的 App Engine 托管.但是,在 GAE 中,您可以使用 Managed VM托管.

Google App Engine (GAE) uses sandboxed Python 2.7 runtime for Python applications. That is the normal App Engine Hosting. However, in GAE you can use Managed VM Hosting.

Managed VM Hosting 让您可以在可配置的 Google Compute Engine 虚拟机上运行 GAE 应用程序.为您提供更大的灵活性.Managed VMs 目前,在 Alpha 阶段,仅支持 Java 7Python 2.7Go 1.4 运行时环境.要获得其他运行时(如 Python 3node.js),您可以创建 用户可配置的自定义运行时.

The Managed VM Hosting lets you run GAE applications on configurable Google Compute Engine Virtual Machines. Giving you more flexibility. Managed VMs at the moment ,at Alpha phase, only support Java 7, Python 2.7 and Go 1.4 runtime environments. To get other runtimes (like Python 3 or node.js) you can create user-configurable custom runtime.

注意:使用托管虚拟机,您将无法获得Python 2.7 GAE 库的功能.

Note: With Managed VMs you won't have the capabilities of Python 2.7 GAE libraries.

  • 如果你坚持使用GAE,由于Python 3+不可行,我建议你学习2.7 并在 GAE 库移植到 Python 3+ 时切换到 3+ 版本.如果您学习了其中一个版本,则可以轻松切换到另一个版本.

  • If you insist on using GAE, since Python 3+ is not viable, I would suggest learning 2.7 and switching to 3+ versions when GAE libraries gets ported to Python 3+. You can easily switch to the other if you learn one of the versions.

如果你坚持使用Python 3+,你可以使用HerokuMicrosoft Azure.它们都支持Python 2.73.4.

这篇关于Google App Engine 是否支持 Python 3?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 01:43