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.

apps.py: Attempted relative import with no known parent package

See original GitHub issue

Attempting to run migrate on a fresh pip install in Django 1.10.7, I got the error

  File "/Users/me/.virtualenvs/proto/lib/python3.6/site-packages/django_q/apps.py", line 3, in <module>
    from .conf import Conf
ImportError: attempted relative import with no known parent package

I was able to fix this by directly editing django_q/apps.py and changing:

from .conf import Conf to from django_q.conf import Conf

I’d do a PR for this, but am not quite sure of what’s going on since no one else seems to be experiencing it. Theories?

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
Koed00commented, Oct 10, 2017

I didn’t see a PR for this, since I’m doing some updates. I’ll see if I can fix some of the relative imports in the code for the next release.

0reactions
Eaglluscommented, Feb 6, 2018

Closing this issue because #264 has been merged. If you still experiencing an issue please reopen this issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flask: ImportError: attempted relative import with no known ...
works with python -m app.app or python app/app.py from the ... files (and from the looks of it a sqlite-database?) with your package....
Read more >
attempted relative import with no known parent package - IQ-Inc
How to fix ImportError: attempted relative import with no known parent package. Learn why it happens and Python import best-practices.
Read more >
Python relative imports in AWS Lambda fail with ... - Github-Gist
Python relative imports in AWS Lambda fail with attempted relative import with no known parent package. The Problem. In AWS Lambda if I...
Read more >
[ERROR FIXED] “Attempted relative import in non ... - Finxter
Another approach to deal with this error is to use the sys.path.append() function to add the directory of the required module to the...
Read more >
[ERROR FIXED] “Attempted relative import in non ... - YouTube
Full Tutorial: https://blog.finxter.com/error-fixed- attempted - relative - import -in-non- package -even-with-__init__- py /Email Academy: ...
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