Aw: Python newbie here! No module named settings

Discussion in 'Python' started by Martin Brochhaus, Jun 2, 2011.

  1. I can only guess.

    1) You can delete "import helper" as that is never used in the code and would raise another "no module" exception.

    2) You can delete "import settings" and just insert some integers further down where it is used (settings.width and settings.height)

    OR

    - you can make the folder where your script resides a python module by adding a __init__.py file
    - then add a settings.py
    - put height = 100 and width = 100 into settings.py
    - you should no longer get that error.

    You probably took that script out of a bigger context. Does it eventually come with a zip-file containing some more files (such as __init__.py and settings.py)?

    Best regards,
    Martin
     
    Martin Brochhaus, Jun 2, 2011
    #1
    1. Advertisements

  2. Re: Python newbie here! No module named settings

    On Jun 2, 8:48 pm, Martin Brochhaus <>
    wrote:
    > I can only guess.
    >
    > 1) You can delete "import helper" as that is never used in the code and would raise another "no module" exception.
    >
    > 2) You can delete "import settings" and just insert some integers furtherdown where it is used (settings.width and settings.height)
    >
    > OR
    >
    > - you can make the folder where your script resides a python module by adding a __init__.py file
    > - then add a settings.py
    > - put height = 100 and width = 100 into settings.py
    > - you should no longer get that error.
    >
    > You probably took that script out of a bigger context. Does it eventuallycome with a zip-file containing some more files (such as __init__.py and settings.py)?
    >
    > Best regards,
    > Martin


    Hey,

    Thanks for your help. I looked into the source directory and both the
    files are there! Its working now :)

    But somehow it worked in Python on Windows installation without any
    such problem. Was using Python 2.7 on Win.

    Anyways, thanks a lot for your help. :)

    Thanks,
    Neeraj
     
    Neeraj Agarwal, Jun 2, 2011
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. K
    Replies:
    8
    Views:
    618
    W Isaac Carroll
    Jul 11, 2003
  2. Harry George
    Replies:
    0
    Views:
    5,997
    Harry George
    Jul 15, 2003
  3. javahead
    Replies:
    1
    Views:
    1,420
    Erik Max Francis
    Oct 8, 2003
  4. eric_bellard
    Replies:
    1
    Views:
    5,531
    CarlosRivera
    Oct 7, 2004
  5. Replies:
    1
    Views:
    24,564
    placid
    Aug 3, 2006
  6. process
    Replies:
    1
    Views:
    1,391
    Robert Kern
    Oct 17, 2008
  7. donet programmer
    Replies:
    3
    Views:
    2,064
    Gregory A. Beamer
    Nov 20, 2009
  8. Replies:
    1
    Views:
    340
    Jason Friedman
    Sep 8, 2012
Loading...