开发者

nosetests 'cannot import name mkdir'

开发者 https://www.devze.com 2023-01-28 20:25 出处:网络
im trying to use nose (NoseGAE) to test my GAE app but it fails with an import error. cant really understand why because what it fails to import is python builtin stuff.

im trying to use nose (NoseGAE) to test my GAE app but it fails with an import error. cant really understand why because what it fails to import is python builtin stuff. im actually testing a simple wsgi app with 1 handler which writes out 'hello world'.

does anyone understand whats going on? im on mac osx snow leopard

this is the traceback:

    Traceback (most recent call last):
  File "/Library/Python/2.6/site-packages/nose-0.11.4-py2.6.egg/nose/loader.py", line 382, in loadTestsFromName
    addr.filename, addr.module)
  File "/Library/Python/2.6/site-packages/nose-0.11.4-py2.6.egg/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/Library/Python/2.6/site-packages/nose-0.11.4-py2.6.egg/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/Users/pepe/DEV/nosetests/tornado/testing.py", line 21, in <module>
    from tornado.httpclient import AsyncHTTPClient
  File "build/bdist.macosx-10.6-universal/egg/nosegae.py", line 204, in load_module
    return super(HookMixin, self).load_module(fullname)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1289, 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 1939, 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 1289, 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 1841, in FindAndLoadModule
    description)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1289, 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 1792, in LoadModuleRestricted
    description)
  File "/Users/pepe/DEV/nosetests/tornado/httpclient.py", line 28, in <module>
    import pycurl
  File "build/bdist.macosx-10.6-universal/egg/nosegae.py", line 204, in load_module
    return super(HookMixin, self).load_module(fullname)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1289, 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 1939, 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 1289, 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 1841, in FindAndLoadModule
    description)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1289, 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 1785, in LoadModuleRestricted
    return source_file.load_module(submodule_fullname)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/dist/py_zipimport.py", line 213, in load_module
    exec code in mod.__dict__
  File "/Library/Python/2.6/site-packages/pycurl-7.19.0-py2.6-macosx-10.6-universal.egg/pycurl.py", line 7, in <module>
    __bootstrap__()
  File "/Library/Python/2.6/site-packages/pycurl-7.19.0-py2.6-macosx-10.6-universal.egg/pycurl.py", line 3, in __bootstrap__
    import sys, pkg_resources, imp
  File "build/bdist.macosx-10.6-universal/egg/nosegae.py", line 204, in load_module
    return super(HookMixin, self).load_module(fullname)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1289, 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 1939, in load_module
    return self.FindAndLoadModule(submodule, fullname, search_path)
  File "/Applicati开发者_开发百科ons/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1289, 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 1841, in FindAndLoadModule
    description)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1289, 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 1785, in LoadModuleRestricted
    return source_file.load_module(submodule_fullname)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/dist/py_zipimport.py", line 213, in load_module
    exec code in mod.__dict__
  File "/Library/Python/2.6/site-packages/setuptools-0.6c12dev_r85381-py2.6.egg/pkg_resources.py", line 24, in <module>
    from os import utime, rename, unlink, mkdir
ImportError: cannot import name mkdir


Google app engine doesn't provide mkdir, there's no writeable filesystem.

http://code.google.com/p/appengine-monkey/issues/detail?id=25 is someone else with the same problem.

0

精彩评论

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

关注公众号