I am teaching myself python from this site. On Chapter 3, when I typed the code in the given example, I got the following error–
Python 3.2 (r32:88445, Mar 25 2011, 19:28:28)
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import turtle
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "turtle.py", line 2, in <module>
wn = turtle.Screen()
AttributeError: 'module' object has no attribute 'Screen'
>>>
Is this something that I need to download and install? I tried looking into docs.python.org, but my nose started to bleed reading all that tech stuff.
Kindly point me in the right direction please? Thank you.
Adam Bernier’s answer is probably correct. It looks like you have a file called
turtle.pythat Python is picking up before the one that came with your Python installation.To track down these problems:
If you see something like this:
Then you’ll want to move
turtle.py(and any correspondingturtle.pycorturtle.pyofiles) in your current working directory out of the way.As per the comments below, you’ll find a wealth of information about a module, including its pathname and contents by calling
help()upon it. For example: