import errors with sdk 1.5.3

64 views
Skip to first unread message

andreas schmid

unread,
Aug 22, 2011, 12:17:12 PM8/22/11
to google-a...@googlegroups.com
hey,

since i upgraded to the new sdk i have issues importing modules
i have some older apps where i use whoosh appengine to index some stuff.

since sdk 1.5.3 i cant run those apps any more.
whoosh-appengine is in the root of the project and the function i want to import is there.

the import:

from whoosh.index import getdatastoreindex

ends in a:

File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 4143, in _HandleRequest
self._Dispatch(dispatcher, self.rfile, outfile, env_dict)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 4049, in _Dispatch
base_env_dict=env_dict)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 616, in Dispatch
base_env_dict=base_env_dict)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 3120, in Dispatch
self._module_dict)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 3024, in ExecuteCGI
reset_modules = exec_script(handler_path, cgi_path, hook)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 2887, in ExecuteOrImportScript
exec module_code in script_module.__dict__
File "/Users/pepe/DEV/edelweissdentistry.project/app-runner.py", line 6, in <module>
from app.app import main
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1538, in Decorate
return func(self, *args, **kwargs)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 2503, in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1538, in Decorate
return func(self, *args, **kwargs)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 2375, in FindAndLoadModule
description)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1538, in Decorate
return func(self, *args, **kwargs)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 2318, in LoadModuleRestricted
description)
File "/Users/pepe/DEV/edelweissdentistry.project/app/app.py", line 19, in <module>
from imageapp.handlers.tags import get_gallery, get_assets, get_collection
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1538, in Decorate
return func(self, *args, **kwargs)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 2503, in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1538, in Decorate
return func(self, *args, **kwargs)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 2375, in FindAndLoadModule
description)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1538, in Decorate
return func(self, *args, **kwargs)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 2318, in LoadModuleRestricted
description)
File "/Users/pepe/DEV/edelweissdentistry.project/imageapp/handlers/tags.py", line 20, in <module>
from imageapp import models
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1538, in Decorate
return func(self, *args, **kwargs)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 2503, in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1538, in Decorate
return func(self, *args, **kwargs)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 2375, in FindAndLoadModule
description)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1538, in Decorate
return func(self, *args, **kwargs)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 2318, in LoadModuleRestricted
description)
File "/Users/pepe/DEV/edelweissdentistry.project/imageapp/models.py", line 21, in <module>
from utils import WhooshToUpdate, unindex_asset
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1538, in Decorate
return func(self, *args, **kwargs)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 2503, in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1538, in Decorate
return func(self, *args, **kwargs)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 2375, in FindAndLoadModule
description)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1538, in Decorate
return func(self, *args, **kwargs)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 2318, in LoadModuleRestricted
description)
File "/Users/myuser/DEV/myproject/app/utils.py", line 9, in <module>
from whoosh.index import getdatastoreindex
ImportError: cannot import name getdatastoreindex

as soon as i switch back to sdk 1.5.2 it works fine.

any suggestions?

thx

Robert Kluin

unread,
Aug 23, 2011, 2:33:43 AM8/23/11
to google-a...@googlegroups.com
Hi Andreas,
Does it still work on production? Have you checked that file to
make sure there is nothing funky going on with it? Have you tried
importing that file yourself? You might also want to see if you
can't figure out if it is trying to load something that has been
blacklisted now (I don't remember the exact error that is raised in
that case).


Robert

> --
> You received this message because you are subscribed to the Google Groups "Google App Engine" group.
> To post to this group, send email to google-a...@googlegroups.com.
> To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
>
>

andreas schmid

unread,
Aug 23, 2011, 3:16:24 AM8/23/11
to google-a...@googlegroups.com
hi,

yes it still works on production, the file is fine and i can import other functions classes in that file but some of them not.
its really weird.
where can i see if something got blacklisted?

Sahid Orentino Ferdjaoui

unread,
Aug 23, 2011, 5:57:04 AM8/23/11
to google-a...@googlegroups.com
I think you need to install the lib whoosh, i had a same problem.

http://pypi.python.org/pypi/Whoosh/

ged

unread,
Aug 23, 2011, 7:58:05 PM8/23/11
to Google App Engine
Yes the newly included whoosh lib in the sdk is getting in the way.
Whoosh should have been internalized so that it would not conflict
with other versions of whoosh.
I would recommend you edit the following files in the sdk

google_appengine/dev_appserver.py

and remove the line

50: os.path.join(DIR_PATH, 'lib', 'whoosh'),

and edit google_appengine/google/appengine/api/search/
simple_search_stub.py

remove the following lines

38: from whoosh import analysis


193: self._tokenizer = analysis.RegexTokenizer() |
analysis.LowercaseFilter()


and replace

212: token_strings = []
if not self._split_restricts:
token_strings = value.lower().split()
else:
token_strings = ...

with

token_strings = value.lower().split()

Ged

On Aug 23, 2:17 am, andreas schmid <a.schmi...@gmail.com> wrote:
> hey,
>
> since i upgraded to the new sdk i have issues importing modules
> i have some older apps where i usewhoosh appengineto index some stuff.
>
> since sdk 1.5.3 i cant run those apps any more.whoosh-appengineis in therootof theprojectand thefunctioniwanttoimportisthere.
>
> theimport:
>
> from whoosh.indeximportgetdatastoreindex
>
> ends in a:
>
> File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 4143, in _HandleRequest
>     self._Dispatch(dispatcher, self.rfile, outfile, env_dict)
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 4049, in _Dispatch
>     base_env_dict=env_dict)
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 616, in Dispatch
>     base_env_dict=base_env_dict)
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 3120, in Dispatch
>     self._module_dict)
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 3024, in ExecuteCGI
>     reset_modules = exec_script(handler_path, cgi_path, hook)
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 2887, in ExecuteOrImportScript
>     exec module_code in script_module.__dict__
>   File "/Users/pepe/DEV/edelweissdentistry.project/app-runner.py", line 6, in <module>
>     from app.appimportmain
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 1538, in Decorate
>     return func(self, *args, **kwargs)
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 2503, in load_module
>     return self.FindAndLoadModule(submodule, fullname, search_path)
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 1538, in Decorate
>     return func(self, *args, **kwargs)
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 2375, in FindAndLoadModule
>     description)
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 1538, in Decorate
>     return func(self, *args, **kwargs)
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 2318, in LoadModuleRestricted
>     description)
>   File "/Users/pepe/DEV/edelweissdentistry.project/app/app.py", line 19, in <module>
>     from imageapp.handlers.tagsimportget_gallery, get_assets, get_collection
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 1538, in Decorate
>     return func(self, *args, **kwargs)
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 2503, in load_module
>     return self.FindAndLoadModule(submodule, fullname, search_path)
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 1538, in Decorate
>     return func(self, *args, **kwargs)
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 2375, in FindAndLoadModule
>     description)
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 1538, in Decorate
>     return func(self, *args, **kwargs)
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 2318, in LoadModuleRestricted
>     description)
>   File "/Users/pepe/DEV/edelweissdentistry.project/imageapp/handlers/tags.py", line 20, in <module>
>     from imageappimportmodels
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 1538, in Decorate
>     return func(self, *args, **kwargs)
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 2503, in load_module
>     return self.FindAndLoadModule(submodule, fullname, search_path)
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 1538, in Decorate
>     return func(self, *args, **kwargs)
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 2375, in FindAndLoadModule
>     description)
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 1538, in Decorate
>     return func(self, *args, **kwargs)
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 2318, in LoadModuleRestricted
>     description)
>   File "/Users/pepe/DEV/edelweissdentistry.project/imageapp/models.py", line 21, in <module>
>     from utilsimportWhooshToUpdate, unindex_asset
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 1538, in Decorate
>     return func(self, *args, **kwargs)
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 2503, in load_module
>     return self.FindAndLoadModule(submodule, fullname, search_path)
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 1538, in Decorate
>     return func(self, *args, **kwargs)
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 2375, in FindAndLoadModule
>     description)
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 1538, in Decorate
>     return func(self, *args, **kwargs)
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngi ne-default.bundle/Contents/Resources/google_appengine/google/appengine/tool s/dev_appserver.py", line 2318, in LoadModuleRestricted
>     description)
>   File "/Users/myuser/DEV/myproject/app/utils.py", line 9, in <module>
>     from whoosh.indeximportgetdatastoreindex
> ImportError: cannotimportname getdatastoreindex

Shay Erlichmen

unread,
Aug 31, 2011, 3:12:44 AM8/31/11
to google-a...@googlegroups.com
open issue 5737
Reply all
Reply to author
Forward
0 new messages