1

I am trying to perform Think Python's turtle-related programs in Eclipse but I always seem to have one error bugging me.

It seems like I have installed Eclipse, Python 2.6 and Python 3.3 correctly in my computer, and linked them to Eclipse via Window>>Preferences>>Interpreter - Python >> New Folder in Libraries. I also did this with Swampy215 and 216.

I run with no problems:

import tkinter
import swampy
from swampy import *

BUT, when I run: import swampy.TurtleWorld OR from swampy import TurtleWorld I get these error messages:

    Traceback (most recent call last):
        import swampy.TurtleWorld   File "C:\Users\mellofr\Downloads\swampy-2.1.6\swampy\TurtleWorld.py", line 8, in <module>
        from Tkinter import TOP, BOTTOM, LEFT, RIGHT, END, LAST, NONE, SUNKEN 
     ImportError: No module named 'Tkinter'

Weirdly, when I type import swampy. Eclipse suggests "TurtleWorld", but seems to ask for Tkinter (Python 2.7) in this process.

kikomello
  • 47
  • 1
  • 7
  • I find that in python 2.7, if you want to use tkinter module, you import it by typing `import Tkinter` or `from Tkinter import ...` Try doing: `from swampy import swampy` and see what happens with that – smac89 Oct 24 '13 at 16:39

1 Answers1

1

Does changing the first line to

import tkinter as Tkinter

help?

See also: "ImportError: No module named tkinter" when using Pmw

Community
  • 1
  • 1
Ghasem Naddaf
  • 862
  • 5
  • 15