What is the problem during running code with import tkinter


#1

Atom version 1.0.19
Python 3.5
OS X 10.11 El Capitan

I have error message with running python codes.
That code starts…


from tkinter import *
import random
import time


But I got a error message.
ImportError: No module named tkinter

What is going wrong ?


#2

Can you give us a bit more of the context? How are you trying to run this python code? Is it through a package?


#3

This code is example of Python Textbook and run normally in IDLE with Python 3.5.

After install package, script, I tried run this code through script.
Then error message showed

Traceback (most recent call last):
File “/Users/Daniel/Downloads/PythonForKidsCode/chapter18/stickmangame7.py”, line 1, in
from tkinter import *
ImportError: No module named tinter


#4

I have the same hier but i’m trying to run the script with "script run code in ATOM"
The same code runs file with text wrangler


Running tkinter on Atom
#5

I’m not sure what this means. What package are you using to run the code? Does the script run in the Terminal when you use python sample.py?


#6

Hi DamnedScholar, thanks for the reply.
What i actually mean is that i’m running the code by pressing on my Mac.
Sorry for not being clear.

Kind regards,

eif


#7

I just tried it with a sample tkinter py project and the same error occurs. I have Python 3.5.
Does that even work? I only see samples for 3.4 and downwards.


#8

By pressing *?

I just tried it with a sample tkinter py project and the same error occurs. I have Python 3.5.
Does that even work? I only see samples for 3.4 and downwards.

This would be a question to ask Python experts.