Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
shacker opened this issue Jul 26, 2017 · 5 comments
Closed

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

shacker opened this issue Jul 26, 2017 · 5 comments

Comments

@shacker
Copy link

shacker commented Jul 26, 2017

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?

@shacker
Copy link
Author

shacker commented Aug 25, 2017

Is no one else experiencing this? I just hit it again with a fresh project. Would a simple PR be accepted with the change above?

@Legen7
Copy link

Legen7 commented Sep 5, 2017

I have this error too. And after I fix the error by ur way,it raise an other error:

 Traceback (most recent call last):
   File "manage.py", line 22, in <module>
     execute_from_command_line(sys.argv)
   File "C:\Python27\CashSever\lib\site-packages\django\core\management\__init__.py", line 367, in execute_from_command_line
     utility.execute()
   File "C:\Python27\CashSever\lib\site-packages\django\core\management\__init__.py", line 341, in execute
     django.setup()
   File "C:\Python27\CashSever\lib\site-packages\django\__init__.py", line 27, in setup
     apps.populate(settings.INSTALLED_APPS)
   File "C:\Python27\CashSever\lib\site-packages\django\apps\registry.py", line 85, in populate
     app_config = AppConfig.create(entry)
   File "C:\Python27\CashSever\lib\site-packages\django\apps\config.py", line 123, in create
     import_module(entry)
   File "C:\Python27\Lib\importlib\__init__.py", line 37, in import_module
    __import__(name)
 ImportError: No module named base

@tawanda
Copy link

tawanda commented Oct 10, 2017

I also experienced the issue on django 1.11 and python 3.6.1

My solution was to put django_q as the last item in installed apps

INSTALLED_APPS = [
       ...,
       ...,
      'django_q'   # <-------last item in list
]

@Koed00
Copy link
Owner

Koed00 commented 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.

@Eagllus
Copy link
Collaborator

Eagllus commented Feb 6, 2018

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

@Eagllus Eagllus closed this as completed Feb 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants