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.

Django 1.9: ImportError or AttributeError

See original GitHub issue

When i do:

import pusher
p = pusher.Pusher

I get: AttributeError: 'module' object has no attribute 'Pusher'

When i do:

from pusher import Pusher
p = Pusher

I get: ImportError: cannot import name Pusher

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
leesiocommented, Jun 16, 2017

It certainly looks like pusher is being overwritten by something else. Is there a pusher.py or a pusher.pyc in the same directory as your application? What happens when you print(pusher) after importing?

1reaction
jbreuer95commented, Feb 16, 2016

My bad! Called my Django project pusher xD

Read more comments on GitHub >

github_iconTop Results From Across the Web

Django 1.9 ImportError for import_module - Stack Overflow
The reason you can import it from django.utils.module_loading is that importlib.import_module is imported in that module, it is not because module_loading in ...
Read more >
try/db.py", line 22, in __getattr__ ... - Google Groups
Hello,. I have been struggling to resolve this problem. I am following the setup -. http://django-oscar.readthedocs.io ...
Read more >
Django Utils - Django documentation
This document covers all stable modules in django.utils . Most of the modules in django.utils are designed for internal use and only the...
Read more >
Django 1.11: AttributeError: 'module' object has no attribute ...
Looking at the code and doing some basic testing, it seems enough to include 'AttributeError' in main.py as below - the instance runs...
Read more >
Django: Compatibility Cheat Sheet - 2020 - BogoToBogo
_thread import get_ident # noqa try: from django.conf.urls import url, patterns, include, handler404, handler500 except ImportError: from ...
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