Aw: Python newbie here! No module named settings

  • Thread starter Martin Brochhaus
  • Start date
M

Martin Brochhaus

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
 
N

Neeraj Agarwal

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top