kikomello
kikomello

Reputation: 47

Trouble connecting Eclipse, tkinter, Swampy and TurtleWorld

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.

Upvotes: 1

Views: 959

Answers (1)

Ghasem Naddaf
Ghasem Naddaf

Reputation: 862

Does changing the first line to

import tkinter as Tkinter

help?

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

Upvotes: 1

Related Questions