开发者

Google App Engine - Production Only - Module Import Error

I am getting this error when running the app in production. It works fine in my local environment. But, after I u开发者_如何学编程pload to server, it throws this exception.

The test_handler module exists in test package (and it works fine in local). I believe that the entire folder structure will be uploaded to the server, when we upload.

Also, is there a way to see the entire folder structure in the Google Application Account online?

============================================================================

<type 'exceptions.ImportError'>: cannot import name test_handler
Traceback (most recent call last):
  File "/base/data/home/apps/mad-scribe/1.346944987034829366/url_handler.py", line 15, in <module>
    from test import test_handler


You can now download the source if you were the developer who uploaded it.

This should give you a concrete understanding of what was uploaded.

AppEngine Docs: Downloading Source Code


The issue was with the package name. I named the package as 'test', which might have stepped on the shoes of some other package.

from test import test_handler

Renaming the package name (test -> test_handlers) fixed the issue.

Thanks to all who responded to this question.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜