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

jupyter - ModuleNotFoundError: No module named 'config' #48

Open
plutext opened this issue Jun 1, 2019 · 1 comment
Open

jupyter - ModuleNotFoundError: No module named 'config' #48

plutext opened this issue Jun 1, 2019 · 1 comment

Comments

@plutext
Copy link

plutext commented Jun 1, 2019

Trying https://github.com/LexPredict/lexpredict-contraxsuite/blob/master/notebook-examples/document_model_tutorial.ipynb in the Docker deployment, at

# Setup django environment
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
django.setup()

I get:

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-5-71fc31a6daec> in <module>()
      5 # Setup django environment
      6 os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
----> 7 django.setup()

/contraxsuite_services/venv/lib/python3.6/site-packages/django/__init__.py in setup(set_prefix)
     17     from django.utils.log import configure_logging
     18 
---> 19     configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
     20     if set_prefix:
     21         set_script_prefix(

/contraxsuite_services/venv/lib/python3.6/site-packages/django/conf/__init__.py in __getattr__(self, name)
     77         """Return the value of a setting and cache it in self.__dict__."""
     78         if self._wrapped is empty:
---> 79             self._setup(name)
     80         val = getattr(self._wrapped, name)
     81         self.__dict__[name] = val

/contraxsuite_services/venv/lib/python3.6/site-packages/django/conf/__init__.py in _setup(self, name)
     64                 % (desc, ENVIRONMENT_VARIABLE))
     65 
---> 66         self._wrapped = Settings(settings_module)
     67 
     68     def __repr__(self):

/contraxsuite_services/venv/lib/python3.6/site-packages/django/conf/__init__.py in __init__(self, settings_module)
    155         self.SETTINGS_MODULE = settings_module
    156 
--> 157         mod = importlib.import_module(self.SETTINGS_MODULE)
    158 
    159         tuple_settings = (

/contraxsuite_services/venv/lib/python3.6/importlib/__init__.py in import_module(name, package)
    124                 break
    125             level += 1
--> 126     return _bootstrap._gcd_import(name[level:], package, level)
    127 
    128 

/contraxsuite_services/venv/lib/python3.6/importlib/_bootstrap.py in _gcd_import(name, package, level)

/contraxsuite_services/venv/lib/python3.6/importlib/_bootstrap.py in _find_and_load(name, import_)

/contraxsuite_services/venv/lib/python3.6/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)

/contraxsuite_services/venv/lib/python3.6/importlib/_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)

/contraxsuite_services/venv/lib/python3.6/importlib/_bootstrap.py in _gcd_import(name, package, level)

/contraxsuite_services/venv/lib/python3.6/importlib/_bootstrap.py in _find_and_load(name, import_)

/contraxsuite_services/venv/lib/python3.6/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)

/contraxsuite_services/venv/lib/python3.6/importlib/_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)

/contraxsuite_services/venv/lib/python3.6/importlib/_bootstrap.py in _gcd_import(name, package, level)

/contraxsuite_services/venv/lib/python3.6/importlib/_bootstrap.py in _find_and_load(name, import_)

/contraxsuite_services/venv/lib/python3.6/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)

ModuleNotFoundError: No module named 'config'

@ghost
Copy link

ghost commented Nov 2, 2019

Running into the same thing in Apache Zeppelin. I've run done django.setup() successfully before in both jup and zepl but not sure why it's failing now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant