Python Forum
problem in finding modules
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem in finding modules
#1
hi,

i,m a complete newbie to python and this forum, so please correct me if i happen to violate any forum rules, by posting in the wrong subforum or anything alike.

i'm working with python 3.5.2 under windows 7.

i'm trying to do the turtleworld assignment from the book by allen downey ("think python", 1st ed., chap.4)
for the assignment i need to import objects from a module. while doing this, i'm told that a certain module, named Gui, which needs to be used in the process, is not existent. the message is:
    from Gui import Callable
ImportError: no module named 'Gui'

the thing is that gui.py is actually located in one of the subfolders of the folder where all the python files are located. i also appended that specific subfolder to the python path, to make sure the system finds it, using the command sys.path.append("\swampy-2.1.5.python3"), even though i'm not sure this is actually necessary, given that the the folder where all the python files are located had already been added to the python path before.
Reply
#2
I don't like this approach from author,making wrapper around(Tkinter,Turtle...ect) to make stuff easier.
The problem is that you would never use this in the real world.
I think it's okay to skip these chapter.

Download swampy-2.1.5.python3.zip
Unpack eg to root folder of Python.
For me it look like this:
import sys
sys.path.append('C:/Python34/swampy-2.1.5')

from TurtleWorld import *
world = TurtleWorld()
bob = Turtle()
print(bob)
wait_for_user()
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020