question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ImportError: cannot import name DebugToolbar

See original GitHub issue

Hi,

Just upgraded django-debug-toolbar to 1.0.1 (thanks for the extensive cleanup and improvements!) in my virtualenv from an older version, followed the new installation instructions but I get the following traceback:

Validating models...

Unhandled exception in thread started by <bound method Command.inner_run of <django.contrib.staticfiles.management.commands.runserver.Command object at 0x2f1aed0>>
Traceback (most recent call last):
  File "/home/julen/envs/pootle-py2.7/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 91, in inner_run
    self.validate(display_num_errors=True)
  File "/home/julen/envs/pootle-py2.7/local/lib/python2.7/site-packages/django/core/management/base.py", line 266, in validate
    num_errors = get_validation_errors(s, app)
  File "/home/julen/envs/pootle-py2.7/local/lib/python2.7/site-packages/django/core/management/validation.py", line 30, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "/home/julen/envs/pootle-py2.7/local/lib/python2.7/site-packages/django/db/models/loading.py", line 158, in get_app_errors
    self._populate()
  File "/home/julen/envs/pootle-py2.7/local/lib/python2.7/site-packages/django/db/models/loading.py", line 67, in _populate
    self.load_app(app_name)
  File "/home/julen/envs/pootle-py2.7/local/lib/python2.7/site-packages/django/db/models/loading.py", line 88, in load_app
    models = import_module('.models', app_name)
  File "/home/julen/envs/pootle-py2.7/local/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/home/julen/envs/pootle-py2.7/src/django-debug-toolbar/debug_toolbar/models.py", line 10, in <module>
    from debug_toolbar.middleware import DebugToolbarMiddleware
  File "/home/julen/envs/pootle-py2.7/src/django-debug-toolbar/debug_toolbar/middleware.py", line 13, in <module>
    from debug_toolbar.toolbar import DebugToolbar
ImportError: cannot import name DebugToolbar

Tried both the quick and explicit setups with the same results.

I’m on Django 1.4.10, and if it’s of some help, I’m using the django-assets app for managing static files.

The issue looks similar to #500.

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
julencommented, Mar 14, 2014

@solova no special details needed, just pip uninstall django-debug-toolbar and pip install django-debug-toolbar.

0reactions
julencommented, Mar 14, 2014

You can try removing the .pyc files from your virtual environment rm $(find . -type f -name "*.pyc"), but apart from that I have no secret sauce.

Read more comments on GitHub >

github_iconTop Results From Across the Web

django ModuleNotFoundError: No module named 'debug ...
Typo error on my part. In settings.py under installed apps I had debug-toolbar instead of debug_toolbar .
Read more >
flask.globals current_app Example Code - Full Stack Python
current_app is function in Flask's flask.globals module and is an instance of ... version("Flask-DebugToolbar") except ImportError: import pkg_resources ...
Read more >
Django Debug Toolbar Loaded but not showing/appearing ...
The Debug Toolbar should have appeared only in Debug mode. So, the rest of the settings will be for DEBUG mode only. #...
Read more >
Django Debug Toolbar - Read the Docs
The Debug Toolbar requires two things from core Django. ... types, Django relies on the mimetypes module from the Python standard library, ...
Read more >
Flask-DebugToolbar - PyPI
Usage. Setting up the debug toolbar is simple: from flask import Flask from flask_debugtoolbar import DebugToolbarExtension app = Flask(__name__) # the toolbar ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found