First time here? Check out the FAQ!
0

Error: ImportError: cannot import name readers

  • retag add tags
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/Django-1.4.3-py2.7.egg/django/core/handlers/base.py", line 101, in get_response
    request.path_info)
  File "/usr/local/lib/python2.7/site-packages/Django-1.4.3-py2.7.egg/django/core/urlresolvers.py", line 298, in resolve
    for pattern in self.url_patterns:
  File "/usr/local/lib/python2.7/site-packages/Django-1.4.3-py2.7.egg/django/core/urlresolvers.py", line 328, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/usr/local/lib/python2.7/site-packages/Django-1.4.3-py2.7.egg/django/core/urlresolvers.py", line 323, in urlconf_module
    self._urlconf_module = import_module(self.urlconf_name)
  File "/usr/local/lib/python2.7/site-packages/Django-1.4.3-py2.7.egg/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/opt/cgmoverflow/urls.py", line 22, in <module>
    (r'%s' % settings.ASKBOT_URL, include('askbot.urls'))
  File "/usr/local/lib/python2.7/site-packages/Django-1.4.3-py2.7.egg/django/conf/urls/__init__.py", line 24, in include
    urlconf_module = import_module(urlconf_module)
  File "/usr/local/lib/python2.7/site-packages/Django-1.4.3-py2.7.egg/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/usr/local/lib/python2.7/site-packages/askbot/urls.py", line 10, in <module>
    from askbot import views
  File "/usr/local/lib/python2.7/site-packages/askbot/views/__init__.py", line 4, in <module>
    from askbot.views import readers
ImportError: cannot import name readers
Michał Wasilewski's avatar
1
Michał Wasilewski
asked 2013-02-22 08:09:03 -0500
Evgeny's avatar
13.2k
Evgeny
updated 2013-02-22 15:51:16 -0500
edit flag offensive 0 remove flag close merge delete

Comments

this is a strange error it has occured to me too.

suhail's avatar suhail (2013-12-05 01:55:16 -0500) edit
add a comment see more comments

3 Answers

1

You can track this down by adding from askbot.views import readers to your django.wsgi and running it interactively (I tested it with django.fcgi, though).

In my case the problem was that I had set TIME_ZONE = None as the django documentation suggests. However, that does not seem to be supported by all parts of the askbot stack:

Traceback (most recent call last):
  File "./django.fcgi", line 14, in <module>
    from askbot.views import readers
  File "/usr/local/lib/python2.7/dist-packages/askbot/views/__init__.py", line 5, in <module>  
    from askbot.views import writers
  File "/usr/local/lib/python2.7/dist-packages/askbot/views/writers.py", line 46, in <module>
    from askbot.templatetags import extra_filters_jinja as template_filters
  File "/usr/local/lib/python2.7/dist-packages/askbot/templatetags/extra_filters_jinja.py", line 35, in <module>
    django_settings.TIME_ZONE
  File "/usr/local/lib/python2.7/dist-packages/pytz/__init__.py", line 162, in timezone
    if zone.upper() == 'UTC':

After setting TIME_ZONE = 'UTC', it worked.

Michael's avatar
11
Michael
answered 2013-12-22 13:00:27 -0500
edit flag offensive 0 remove flag delete link

Comments

Unfortunately Django tends to hide some of the compile time errors under the "import error". Not sure if it's entirely the fault of our code base.

Evgeny's avatar Evgeny (2013-12-22 13:06:21 -0500) edit
add a comment see more comments
0

It looks that either something is really wrong with your python path or there are import errors which might be due to missing modules.

Evgeny's avatar
13.2k
Evgeny
answered 2013-02-22 15:52:09 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
0

In my case, installing jinja2 at the proper place was the solution.

ProfGra's avatar
36
ProfGra
answered 2014-07-11 01:54:07 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments