AttributeError: 'module' object has no attribute '__path__'

Jeff Bauer avatarJeff Bauer created an issue

Just a quick traceback dump before I forget to submit a bug ticket. ;-)

I'm running this as a non-app: ./ test

Traceback (most recent call last):
  File "", line 11, in <module>
  File "/home/jbauer/.virtualenvs/py272/lib/python2.7/site-packages/django/core/management/", line 438, in execute_manager
  File "/home/jbauer/.virtualenvs/py272/lib/python2.7/site-packages/django/core/management/", line 379, in execute
  File "/home/jbauer/.virtualenvs/py272/lib/python2.7/site-packages/django/core/management/", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/jbauer/.virtualenvs/py272/lib/python2.7/site-packages/django/core/management/", line 220, in execute
    output = self.handle(*args, **options)
  File "/home/jbauer/.virtualenvs/py272/lib/python2.7/site-packages/django/core/management/commands/", line 37, in handle
    failures = test_runner.run_tests(test_labels)
  File "/home/jbauer/.virtualenvs/py272/lib/python2.7/site-packages/django_coverage/", line 90, in run_tests
  File "/home/jbauer/.virtualenvs/py272/lib/python2.7/site-packages/django_coverage/utils/module_tools/", line 133, in get_all_modules
    _get_all_modules(pkg_name, pkg, blacklist)
  File "/home/jbauer/.virtualenvs/py272/lib/python2.7/site-packages/django_coverage/utils/module_tools/", line 112, in _get_all_modules
    for p in pkg.__path__:
AttributeError: 'module' object has no attribute '__path__'

Comments (3)

  1. Terr

    I had the same problem. Turns out I had an (old, empty) directory with the same name as a Python package (permissions/,[c]). The directory didn't contain a, so I'm not sure why it was identified as a package.

    Deleting the directory fixed the problem, but improving package detection code would be better of course.

  2. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.