Can't import turtle module in Python 2.x and Python 3.x

Mind Mixer

I want to play with turtle module in Python. But when i do import turtle module, i've the following error:

$ python
Python 2.7.3 (default, Sep 26 2012, 21:51:14) 
[GCC 4.7.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 3, in <module>                                                                                 
    myTurtle = turtle.Turtle()                                                                                                 
AttributeError: 'module' object has no attribute 'Turtle'

and for Python 3.x:

$ python3
Python 3.2.3 (default, Sep 30 2012, 16:41:36) 
[GCC 4.7.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 3, in <module>
    myTurtle = turtle.Turtle()
AttributeError: 'module' object has no attribute 'Turtle'

I working under Kubuntu Linux 12.10. I've played with Tkinter gui. There is no problem. What happen with turtle module?

Ignacio Vazquez-Abrams

You've called a script turtle.py, which is shadowing the turtle module in the standard library. Rename it.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Can't import module in python

From Dev

Can't import module in python

From Dev

How to parse Python 2.x with Python 3.x ast module?

From Dev

Can not import name from x in python 2.7

From Dev

How can I import an image in Python Turtle?

From Dev

Can I import Python's 3.6's formatted string literals (f-strings) into older 3.x, 2.x Python?

From Dev

python 3: import module

From Dev

Can't run my turtle Python3 files

From Dev

Unloading a module in Python 3.x

From Dev

Unloading a module in Python 3.x

From Dev

How to import third party python module Mac OS X - anki

From Dev

Can't find '_sqlite3' module when import it using python which installed by pyenv

From Dev

Can't import openCV in python 3

From Dev

Turtle Module in python not importing

From Dev

Switch in Python Turtle Module

From Dev

Turtle Python Module

From Dev

Python: Eval with undefined variables (2*x+x = 3*x)

From Dev

Python 3 can't find 'gi' module

From Java

Why is 2 * x * x faster than 2 * ( x * x ) in Python 3.x, for integers?

From Dev

Why is 2 * x * x faster than 2 * ( x * x ) in Python 3.x, for integers?

From Dev

Script incompatibility for Python 2.x and Python 3.x

From Dev

Geocoding Strategies - Python 2.x to Python 3.x

From Dev

How can I get 2.x-like sorting behaviour in Python 3.x?

From Dev

Can't import custom Python module using Eclipse

From Dev

Can't import own python module in Postgresql plpython function

From Dev

root able to import python module, but user can't

From Dev

Can't import custom python module using multiprocess library

From Dev

Python 3 module import error

From Dev

Import module in python3

Related Related

HotTag

Archive