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

Error was: Could not import settings 'project.settings.local' #200

Open
jonathan-s opened this issue Sep 13, 2014 · 2 comments
Open

Error was: Could not import settings 'project.settings.local' #200

jonathan-s opened this issue Sep 13, 2014 · 2 comments

Comments

@jonathan-s
Copy link

ERROR:root:Error while trying to get django settings module.
Error was: Could not import settings 'project.settings.local' (Is it on sys.path? Is there an import error in the settings file?): No module named project.settings.local

I get this error as I try to pip install it from the repo. Any clues? If I try to import it from python it works perfectly.

@Alir3z4
Copy link

Alir3z4 commented Oct 21, 2014

@jonathan-s Which version you're trying to install, I patched this error a while ago and it's in the master right now.

Have you tried to install Django(nonrel fork) first ?

@kaedroho
Copy link

kaedroho commented Feb 3, 2015

I am getting this error as well. Heres my traceback

       Downloading django-mongodb-engine-0.5.1.tar.gz
       Running setup.py (path:/tmp/pip_build_u28212/django-mongodb-engine/setup.py) egg_info for package django-mongodb-engine
       Traceback (most recent call last):
       File "<string>", line 17, in <module>
       File "/tmp/pip_build_u28212/django-mongodb-engine/setup.py", line 3, in <module>
       import django_mongodb_engine as distmeta
       File "django_mongodb_engine/__init__.py", line 41, in <module>
       if isinstance(settings.INSTALLED_APPS, tuple):
       File "/app/.heroku/python/lib/python2.7/site-packages/django/conf/__init__.py", line 46, in __getattr__
       self._setup(name)
       File "/app/.heroku/python/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
       self._wrapped = Settings(settings_module)
       File "/app/.heroku/python/lib/python2.7/site-packages/django/conf/__init__.py", line 98, in __init__
       % (self.SETTINGS_MODULE, e)
       ImportError: Could not import settings 'wagtaildemo.settings.heroku' (Is it on sys.path? Is there an import error in the settings file?): No module named wagtaildemo.settings.heroku
       Complete output from command python setup.py egg_info:
       Traceback (most recent call last):

       File "<string>", line 17, in <module>

       File "/tmp/pip_build_u28212/django-mongodb-engine/setup.py", line 3, in <module>

       import django_mongodb_engine as distmeta

       File "django_mongodb_engine/__init__.py", line 41, in <module>

       if isinstance(settings.INSTALLED_APPS, tuple):

       File "/app/.heroku/python/lib/python2.7/site-packages/django/conf/__init__.py", line 46, in __getattr__

       self._setup(name)

       File "/app/.heroku/python/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup

       self._wrapped = Settings(settings_module)

       File "/app/.heroku/python/lib/python2.7/site-packages/django/conf/__init__.py", line 98, in __init__

       % (self.SETTINGS_MODULE, e)

       ImportError: Could not import settings 'wagtaildemo.settings.heroku' (Is it on sys.path? Is there an import error in the settings file?): No module named wagtaildemo.settings.heroku

It looks like the issue is being caused by setup.py importing django_mongodb_engine/__init__.py which imports django settings. I have set DJANGO_SETTINGS_MODULE environment variable globally (using Heroku) which is why it knows where to look. I am using Django 1.7.1.

EDIT:

After some further investigation, I found that this is being caused by having the DJANGO_SETTINGS_MODULE set while installing django-mongodb-engine.

To reproduce, just run: DJANGO_SETTINGS_MODULE=blah.blah pip install django-mongodb-engine

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

3 participants