2013-03-02 116 views
0

由於某些原因,當我上傳我的應用程序引擎項目昨天(在此之前,一切工作正常),它找不到我的.py文件/模塊之一。我的目錄如下:谷歌應用程序引擎找不到本地python模塊

app_directory/ 
    gaesessions/ 
    __init__.py 
    lib/ 
    httplib2/ 
     __init__.py 
     other stuff 
    app.yaml 
    appengine_config.py 
    index.yaml 
    All other .py files/modules 

出於某種原因,我現在得到以下錯誤:

import_string() failed for 'games.GetMyGames'. Possible reasons are: 

- missing __init__.py in a package; 
- package or module path not included in sys.path; 
- duplicated package or module name taking precedence in sys.path; 
- missing module, class, function or variable; 

Original exception: 

ImportError: cannot import name GameModel 

回答

1

我意識到我有一個圓形的進口:

在File1.py

from File2 import class1 

and in File2.py

在File1.py

import File2 

和File2.py

import File1 

,我感動了所有我從File1和文件2類進口進一步下跌的文件,這一點:

我改解決了我的問題。希望這可以幫助別人。

+1

是的..循環進口是邪惡的,通常錯誤消息不會告訴你:) – Lipis 2013-03-04 10:39:18

相關問題