Error during running tkinter module


#1

Traceback (most recent call last):
File “.#1 opening window.py”, line 1, in
from tkinter import *
ImportError: No module named tkinter

help plz ??


#2

Does it work outside of Atom?


#4

yes, actually it run in atom’s terminal


#5

Screenshot%20at%202018-07-25%2001%3A52%3A30

This its


#6

Are you sure it’s running the right Python version? I noice you specify 3.6 in the second command, but not in the first. I believe the default will run 2.7 (which has a different list of installed packages).


#7

Screenshot%20at%202018-07-25%2012%3A03%3A52

now i specify the python version ??


#8

First, confirm it fails from your computers command line (you say “atom’s terminal”, so I’m assuming you’re using a package in Atom to run these commands).

If it fails, I don’t know much about Python modules or tkinter. You will probably get better support in a dedicated Python / tkinter forum.

However, if the project works outside of Atom, then it is a problem with an Atom package and we may be able to help investigate further.


#9

yes it work out side atom, and i hope you be able to help

thanks


#10

Hello.

For me it does not work from the normal command line. Only when opening IDLE am I able to do anything. This seems to be a Python type issue, not limited to Atom.

Researching the web came up with:

from tkinter import *
tk = Tk()
btn = Button(tk, text='click me')
btn.pack()
tk.mainloop()

Also running with python -i fileName.py was suggested.

Please go ahead and try the code piece.

Cheers.


#11

yes it is , i run it like this


What is the problem during running code with import tkinter
#12

Please elaborate.


#13

Screenshot%20at%202018-07-25%2001%3A52%3A30

thats what i actually mean