Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialNitin Desai
977 PointsImportError: No module named 'monster'
Hi There! I have problem importing Monster to my IDLE workspace.
Here is my error:
from monster import Monster Traceback (most recent call last): File "<pyshell#2>", line 1, in <module> from monster import Monster ImportError: No module named 'monster'
My IDLE session can not find the class Monster. I need to know where do I need to save my class Monster script.
5 Answers
Vittorio Somaschini
33,371 PointsHello Nitin.
With the hints that you have written I would presume that your Monster class definition is in a file called monster.py. Is this the case?
Vittorio
Nitin Desai
977 PointsHi Vittorio,
Yes, the file is called monster.py as the lesson shows. The IDLE is setup in windows 8.1.
Vittorio Somaschini
33,371 PointsI presume that if the monster.py file is in the same folder as the app you are running it should work fine.
How have you organized the project? Do you have folders and subfolders?
Nitin Desai
977 Pointsyes, monster.p;y is in the same folder as where I run the app.
Kenneth Love
Treehouse Guest TeacherCan you show me the code from monster.py
?