Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Python newbie here! No module named settings

7,055 views
Skip to first unread message

Neeraj Agarwal

unread,
Jun 2, 2011, 11:29:48 AM6/2/11
to
Hello all,

I'm a newbie to Python and its my 2nd day exploring it.

I was trying to use Python wrapper for Google Charts API and was
tweaking the examples.
https://github.com/gak/pygooglechart/raw/master/examples/pie.py

This is the script which I was trying.

And the python interpreter gives the following error:
import settings
ImportError: No module named settings

I installed Django as well before this (if its causing the problem,
dunno)

Please help me.

Thanks,
Neeraj

Martin Brochhaus

unread,
Jun 2, 2011, 11:48:41 AM6/2/11
to
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

Neeraj Agarwal

unread,
Jun 2, 2011, 12:23:15 PM6/2/11
to
On Jun 2, 8:48 pm, Martin Brochhaus <martin.brochh...@googlemail.com>
wrote:

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

chandragan...@gmail.com

unread,
Sep 7, 2012, 8:05:29 AM9/7/12
to
hi neeraj,
I am also experiencing the same problem and in my pygooglechart file i am not having both settings.py and __init__.py file so can you send me the link from where you downloaded api
Best Regards,
ganesh

Jason Friedman

unread,
Sep 8, 2012, 12:16:20 AM9/8/12
to pytho...@python.org
>> I was trying to use Python wrapper for Google Charts API and was
>> tweaking the examples.
>> https://github.com/gak/pygooglechart/raw/master/examples/pie.py
>>
>> This is the script which I was trying.
>>
>> And the python interpreter gives the following error:
>> import settings
>> ImportError: No module named settings
>>
>> I installed Django as well before this (if its causing the problem,
>> dunno)

I searched Google for "django import settings" and found a few links
that might be helpful.

rdavi...@gmail.com

unread,
Apr 12, 2015, 9:22:25 PM4/12/15
to
Thanks, your answer was a big help.
0 new messages