First time here? Check out the FAQ!
0

Error: ImportError: cannot import name readers
 

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

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Michał Wasilewski's avatar
1
Michał Wasilewski
asked 12 years ago
Evgeny's avatar
13.2k
Evgeny
updated 12 years ago

Comments

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

suhail's avatar suhail (11 years ago)
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.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Michael's avatar
11
Michael
answered 11 years ago
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 (11 years ago)
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.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
answered 12 years ago
link

Comments

see more comments
0

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

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
ProfGra's avatar
36
ProfGra
answered 10 years ago
link

Comments

see more comments