0

我正在从 github (https://github.com/sunlightlabs/publicmarkup) 安装一个 python 项目,我收到以下错误消息:

File "/usr/local/lib/python2.7/dist-packages/django/core/servers/basehttp.py", line 283, in run
    self.result = application(self.environ, self.start_response)

  File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/handlers.py", line 68, in __call__
    return self.application(environ, start_response)

  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 273, in __call__
    response = self.get_response(request)

  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 169, in get_response
    response = self.handle_uncaught_exception(request, resolver, sys.exc_info())

  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 214, in handle_uncaught_exception
    if resolver.urlconf_module is None:

  File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 274, in _get_urlconf_module
    self._urlconf_module = import_module(self.urlconf_name)

  File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)

  File "/home/mbenchoufi/git/publicmarkup/../publicmarkup/urls.py", line 5, in <module>
    add_to_builtins('mediasync/templatetags/media')

  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 1016, in add_to_builtins
    builtins.append(import_library(module))

  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 951, in import_library
    app_path, taglib = taglib_module.rsplit('.',1)

ValueError: need more than 1 value to unpack

我是python的新手,这个错误信息是什么意思?

4

1 回答 1

1

add_to_builtins调用不正确,publicmarkup/urls.py应该

add_to_builtins('mediasync.templatetags.media')

Python 包是点分隔的,作者使用了路径。

稍后,Django 框架尝试加载模块,并在最后一个点失败后拆分姓氏,因为原始调用中没有点。

看起来您尝试加载的项目从根本上被破坏了。它可能还会有其他错误。

于 2012-09-29T21:47:59.760 回答