Ask Your Question
0

Error: ImportError: cannot import name readers

asked 2013-02-22 08:09:03 -0600

Michał Wasilewski gravatar image

updated 2013-02-22 15:51:16 -0600

Evgeny gravatar image
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
edit retag flag offensive close merge delete

Comments

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

suhail gravatar imagesuhail ( 2013-12-05 01:55:16 -0600 )edit

3 Answers

Sort by » oldest newest most voted
1

answered 2013-12-22 13:00:27 -0600

Michael gravatar image

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.

edit flag offensive delete link more

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 gravatar imageEvgeny ( 2013-12-22 13:06:21 -0600 )edit
0

answered 2014-07-11 01:54:07 -0600

ProfGra gravatar image

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

edit flag offensive delete link more
0

answered 2013-02-22 15:52:09 -0600

Evgeny gravatar image

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

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-02-22 08:09:03 -0600

Seen: 1,256 times

Last updated: Jul 11 '14