“ImportError:没有名为ekeet.models的模块”使用mongokit设置Pylons时

时间:2011-01-05 21:32:44

标签: python mongodb pylons mongokit

我尝试设置默认的pylons项目,按照此处的指示使用mongokit: http://namlook.github.com/mongokit/pylons.html

然而它给了我错误:

>Traceback (most recent call last):
File "/usr/bin/paster", line 18, in

>command.run()
File "/usr/lib/pymodules/python2.6/paste/script/command.py", line 84, in run

>invoke(command, command_name, options, args[1:])
File "/usr/lib/pymodules/python2.6/paste/script/command.py", line 123, in invoke

>exit_code = runner.run(args)
File "/usr/lib/pymodules/python2.6/paste/script/command.py", line 218, in run

>result = self.command()
File "/usr/lib/pymodules/python2.6/paste/script/serve.py", line 276, in command

>relative_to=base, global_conf=vars)
File "/usr/lib/pymodules/python2.6/paste/script/serve.py", line 313, in loadapp

>**kw)
File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 204, in loadapp

>return loadobj(APP, uri, name=name, **kw)
File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 224, in loadobj

>global_conf=global_conf)
File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 248, in loadcontext

>global_conf=global_conf)
File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 278, in _loadconfig

>return loader.get_context(object_type, name, global_conf)
File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 409, in get_context

>section)
File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 431, in _context_from_use

>object_type, name=use, global_conf=global_conf)
File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 361, in get_context

>global_conf=global_conf)
File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 248, in loadcontext

>global_conf=global_conf)
File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 285, in _loadegg

>return loader.get_context(object_type, name, global_conf)
File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 561, in get_context

>object_type, name=name)
File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 587, in find_egg_entry_point

>possible.append((entry.load(), protocol, entry.name))
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1954, in load

>entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/home/ciferkey/Projects/runnr-site/runnrsite/config/middleware.py", line 11, in

>from runnrsite.config.environment import load_environment
File "/home/ciferkey/Projects/runnr-site/runnrsite/config/environment.py", line 8, in

>import runnrsite.lib.app_globals as app_globals
File "/home/ciferkey/Projects/runnr-site/runnrsite/lib/app_globals.py", line 2, in

>from ekeet.models import register_models

>ImportError: No module named ekeet.models

我无法在其他任何地方找到任何帮助,甚至模块的ekeet是什么。为什么会发生这种情况?

编辑:我明白了。这必须是教程中使用的pylons项目的名称。 ekeet.modules应该是你把register_model放进去的模块。下次我不会这么快问!

1 个答案:

答案 0 :(得分:0)

显然ekeet只是一个例子。你应该自己组成自己的名字。关键是register_models应该是您要注册的所有模块的列表。您需要根据自己的需要调整名称。