python - 如何在 Windows 上正确运行 Google App Engine Web 服务器?

标签 python google-app-engine python-3.x python-2.x

我尝试使用 Python 3.2 和 Python 2.7 运行 Google App Engine 开发服务器,但都出现错误:

python 2.7:

D:\nCdy\WA>C:\Python27\python.exe "D:\Program Files\Google\google_appengine\dev_
appserver.py" wa.py
Traceback (most recent call last):
  File "D:\Program Files\Google\google_appengine\dev_appserver.py", line 76, in
<module>
    run_file(__file__, globals())
  File "D:\Program Files\Google\google_appengine\dev_appserver.py", line 72, in
run_file
    execfile(script_path, globals_)
  File "D:\Program Files\Google\google_appengine\google\appengine\tools\dev_apps
erver_main.py", line 156, in <module>
    from google.appengine.tools import dev_appserver
  File "D:\Program Files\Google\google_appengine\google\appengine\tools\dev_apps
erver.py", line 179, in <module>
    mimetypes.add_type(mime_type, '.' + ext)
  File "C:\Python27\lib\mimetypes.py", line 344, in add_type
    init()
  File "C:\Python27\lib\mimetypes.py", line 355, in init
    db.read_windows_registry()
  File "C:\Python27\lib\mimetypes.py", line 259, in read_windows_registry
    for ctype in enum_types(mimedb):
  File "C:\Python27\lib\mimetypes.py", line 249, in enum_types
    ctype = ctype.encode(default_encoding) # omit in 3.x!
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position 0: ordinal
not in range(128)

python 3.2:

D:\nCdy\WA>C:\Python32\python.exe "D:\Program Files\Google\google_appengine\dev_
appserver.py" wa.py
Traceback (most recent call last):
  File "D:\Program Files\Google\google_appengine\dev_appserver.py", line 76, in
<module>
    run_file(__file__, globals())
  File "D:\Program Files\Google\google_appengine\dev_appserver.py", line 72, in
run_file
    execfile(script_path, globals_)
NameError: global name 'execfile' is not defined 

如何运行它?

最佳答案

它不适用于 Python 3.2。

我在 Windows 7 上使用 GAE 和 Python 2.7 没有遇到任何问题。它很快就会成为官方支持的版本。

目前,官方支持的版本是 Python 2.5,因此如果您在使用其他版本时遇到任何问题,您应该下载它。

我建议像 ActiveState 这样的东西因为没有最新版本的 Python 2.5 的官方二进制文件。

关于python - 如何在 Windows 上正确运行 Google App Engine Web 服务器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7073679/

相关文章:

python - Paramiko 上传文件成功但为空

java - 有没有办法使用 App Engine Java 运行时动态设置任务的目标?

php - GAE - php5.5 - PHP 运行时不可用

python - curl 作为 Zapier Webhook 到 Stripe

python - Celery worker 不会在当前任务完成后接手新任务

python - 使用 BeautifulSoup 创建 XML 文档

google-app-engine - bigtable 上的全文搜索

python - 如何使用csv和pandas制作产品代码列表?

python - 破解编码面试,第 6 版,1.7

python-3.x - 嘿,我可以在 pandas 中通过箱线图绘制一个组来删除未使用的类别吗?