1

I'm running Fedora 17 and I had Eclipse installed. I'm trying to do an assignment that uses python Turtle by importing turtle. I get red flags whenever I use the turtle methods, like turtle.forward(100)

I get this error:

Traceback (most recent call last):
  File "/home/g2n/Desktop/school/college/cs/240/src/cw1/faces.py", line 6, in <module>
    import turtle
  File "/usr/local/lib/python3.3/turtle.py", line 107, in <module>
    import tkinter as TK
  File "/usr/local/lib/python3.3/tkinter/__init__.py", line 40, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
ImportError: No module named '_tkinter'

My pydev path is /usr/local/bin/python3.3

Anyone help?!

Karl Knechtel
  • 62,466
  • 11
  • 102
  • 153
Matt M
  • 149
  • 2
  • 4
  • 17

2 Answers2

1

Like the other link said, make sure you install tk-dev before trying to import the module in python; i would also test this on a Python 2.7 interpreter, 3.3 is too new and Tkinter may not be entirely supported or not well tested. So, if allowed, try 2.7.

Make sure you are importing it correctly: import Tkinter

Here's how to install Tkinter http://tkinter.unpythonic.net/wiki/How_to_install_Tkinter

And here's a link that can provide you with some RPMs for Tkinter: http://rpmfind.net/linux/rpm2html/search.php?query=tk-devel

Dayan
  • 7,634
  • 11
  • 49
  • 76
  • 1
    `tk-dev` is not needed to use tkinter. It is only needed to build another python with tkinter support. And python3.3 is not so new and works (and is tested) perfectly on recent distros. – FabienAndre Jan 11 '13 at 21:40
  • I did an install for tk-dev and it didn't work. Importing tkinter also doesn't work. – Matt M Jan 11 '13 at 22:35
-1
  1. Check dependencies and all of the needed libraries - Think Python clearly states that.
  2. Try to use not a python3.3 but earlier python version 2.7
  3. Why do you need eclipse? and what OS you are running?
chupvl
  • 1,258
  • 2
  • 12
  • 20