python - itertools 在 GAE 中不起作用?

标签 python google-app-engine

错误日志:

2011-12-05 14:56:01.211

<type 'exceptions.AttributeError'>: 'module' object has no attribute 'product'
Traceback (most recent call last):
  File "/base/data/home/apps/s~ellipt-test/1.355173855249110456/helloworld.py", line 494, in <module>
    F16 = field_elements(2, 4)
  File "/base/data/home/apps/s~ellipt-test/1.355173855249110456/helloworld.py", line 218, in field_elements
    result = list(itertools.product(*([range(p)]*n)))

有什么问题?在我的电脑上,脚本有效!

最佳答案

app engine docs说:

Your application can run in one of three runtime environments: […] a choice of Python 2.5 or the experimental Python 2.7.

我假设这意味着默认的 Python 是 2.5 版。

itertools.product()文档说:

New in version 2.6.

我不太熟悉 GAE,所以不确定您如何将您的应用切换为使用 2.7。

关于python - itertools 在 GAE 中不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8393719/

相关文章:

google-app-engine - 将 appengine 与 arch 和 zsh 一起使用无法找到 goapp

google-app-engine - 使用 Play Framework 和 Google App Engine 的 HttpOnly/secure cookies

java - 使用 eclipse 插件在 GAE 上部署应用程序

python - 如何对来自pyaudio的麦克风音频信息进行数学分析?

python - Django 模型父链接的自定义相关名称?

python - 特定模式的正则表达式

python - 如何正确传递文本文件来搜索那里的数据?

python - 数据库设计正确

python - 使用 Python Spacy 从简单被动语态句子中提取实体

laravel - 如何将 Laravel 5.2/Laravel 5.3 添加到 Google App Engine?