Menu

#1303 "Could not import settings" error

open-accepted
debugger (210)
5
2011-04-06
2011-04-06
No

I just installed the latest released production version of PyDev (2.0), and now when launching my project (tiger) in debug I consistently get this message and it won't start. Yesterday with the previous version of PyDev it worked fine. Any ideas?

pydev debugger: warning: psyco not available for speedups (the debugger will still work correctly, but a bit slower)
pydev debugger: starting
Error: Could not import settings 'tiger.settings' (Is it on sys.path? Does it have syntax errors?): Could not import settings 'tiger.settings' (Is it on sys.path? Does it have syntax errors?): No module named settings

Discussion

  • Fabio Zadrozny

    Fabio Zadrozny - 2011-04-06
    • status: open --> pending
     
  • Fabio Zadrozny

    Fabio Zadrozny - 2011-04-06

    Is your project configured as django? It seems that it's expecting tiger.settings to be your django settings module -- if the settings module is in a different location, please create a string substitution variable named 'DJANGO_SETTINGS_MODULE' in your project (right click project > properties > PyDev PYTHONPATH > String substitution variables) and point that variable to your module name (i.e.: tiger.my_settings).

    If your project is not a Django project, this shouldn't happen (note that you can remove the django project configuration by right clicking the project > django > remove django project config).

     
  • Roger Underwood

    Roger Underwood - 2011-04-06

    The lack of the DJANGO_SETTINGS_MODULE was indeed the issue. I could have sworn that was there previously though. If not, I wonder how it worked in debug yesterday? Anyway, thanks so much. Great tool!

     
  • Roger Underwood

    Roger Underwood - 2011-04-06
    • status: pending --> open
     
  • Fabio Zadrozny

    Fabio Zadrozny - 2011-04-06

    This variable wasn't properly passed when launching pydev (which could lead to other errors), and now if not specified a 'default' is used -- maybe it should always ask instead of trying to use a default... will think a bit about it :)

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2011-04-06
    • status: open --> open-accepted
     
  • Anonymous

    Anonymous - 2011-06-07

    Ok, this issue has kept me occuppied for quite some time now. I found the reason in the source code I downloaded from Github. Eventually I found this issue here at sf.

    I don't know if it can be classified as a bug, but it is quite annoying. I was attempting to set the DJANGO_SETTINGS_MODULE in the Environment tab of a 'run configuration'. But setting it there won't work because it gets overridden by `PythonRunnerConfig` . You _have_ to set it in your *project's* properties. This is not clearly stated in the docs.

    Note I'm in this case only using django's db api from my own scripts (not running manage.py).

    Cheers.

    Marko

     

    Last edit: Anonymous 2013-11-21
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.