2011-12-06 33 views
2

錯誤日誌:itertools在GAE中不起作用?

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))) 

什麼問題?在我的計算機上,腳本正常工作!

回答

8

app engine docs說:

您的應用程序可以在三種運行環境中運行:[...] Python 2.5的或實驗性的Python 2.7的選擇。

我假設這意味着默認的Python版本是2.5。

itertools.product()文檔說:

新版本2.6。

我對GAE並不是很熟悉,所以不確定如何切換應用程序以使用2.7。