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

SystemError: Parent module '' not loaded, cannot perform relative import #142

Closed
carltongibson opened this issue Feb 2, 2016 · 2 comments

Comments

@carltongibson
Copy link

I have an import problem with Django-Q 0.7.15 and Django 1.8.6 using Python 3.5

Django-Q is installed and able to import:

$ ipython
Python 3.5.0 (default, Sep 15 2015, 13:36:21) 
Type "copyright", "credits" or "license" for more information.

IPython 4.0.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import django_q

In [2]: django_q
Out[2]: <module 'django_q' from '.../python3.5/site-packages/django_q/__init__.py'>

But as soon as I add django_q to my INSTALLED_APPS Django can't get past the django.setup() call:

$ ./manage.py shell
Traceback (most recent call last):
  File "./manage.py", line 11, in <module>
    execute_from_command_line(sys.argv)
  File ".../python3.5/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
    utility.execute()
  File ".../python3.5/site-packages/django/core/management/__init__.py", line 328, in execute
    django.setup()
  File ".../python3.5/site-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File ".../python3.5/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File ".../python3.5/site-packages/django/apps/config.py", line 86, in create
    module = import_module(entry)
  File ".../python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 944, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 662, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File ".../python3.5/site-packages/django_q/apps.py", line 3, in <module>
    from .conf import Conf
SystemError: Parent module '' not loaded, cannot perform relative import

No doubt I'm holding it wrong. :-) Can you advise?

@carltongibson
Copy link
Author

Curious... If I put django_q very last in INSTALLED_APPS Django loads... — I'm going to assume this is an issue caused somewhere else in the application.

@Koed00
Copy link
Owner

Koed00 commented Feb 2, 2016

I'm currently running quite a few servers with the same setup and I've not encountered this problem yet.
So I'm guessing you're right that some other package is breaking something. Even so, reopen this if you encounter similar problems again. Thanks for reporting this.

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

2 participants