GPIOSim icon indicating copy to clipboard operation
GPIOSim copied to clipboard

Error: No module named tkinter

Open lastimam opened this issue 8 years ago • 14 comments

Traceback (most recent call last): File "GPIOSim.py", line 18, in from tkinter import Tk, Canvas, Frame, BOTH, Menu, Label, PhotoImage ImportError: No module named tkinter

lastimam avatar Oct 09 '16 09:10 lastimam

Python version?

Il giorno 09 ott 2016, alle ore 11:34, lastimam [email protected] ha scritto:

Traceback (most recent call last): File "GPIOSim.py", line 18, in from tkinter import Tk, Canvas, Frame, BOTH, Menu, Label, PhotoImage ImportError: No module named tkinter

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

bobvann avatar Oct 09 '16 17:10 bobvann

pi@raspberrypi:~/Desktop $ python GPIOSim.py Traceback (most recent call last): File "GPIOSim.py", line 18, in from tkinter import Tk, Canvas, Frame, BOTH, Menu, Label, PhotoImage File "/usr/local/lib/python3.5/tkinter/init.py", line 35, in import _tkinter # If this fails your Python may not be configured for Tk ImportError: No module named '_tkinter'

pi@raspberrypi:~/Desktop $ python --version Python 3.5.2

lastimam avatar Oct 10 '16 04:10 lastimam

Try to import Tkinter instead of tkinter

Uppercase T

Il giorno 10 ott 2016, alle ore 06:48, lastimam [email protected] ha scritto:

pi@raspberrypi:~/Desktop $ python -V Python 3.5.2

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

bobvann avatar Oct 10 '16 08:10 bobvann

but since you’re running GPIOSim on the RaspberryPi itself, I guess you did not correctly understand what GPIOSim is about :)

Il giorno 10 ott 2016, alle ore 06:53, lastimam [email protected] ha scritto:

pi@raspberrypi:~/Desktop $ python GPIOSim.py Traceback (most recent call last): File "GPIOSim.py", line 18, in from tkinter import Tk, Canvas, Frame, BOTH, Menu, Label, PhotoImage File "/usr/local/lib/python3.5/tkinter/init.py", line 35, in import _tkinter # If this fails your Python may not be configured for Tk ImportError: No module named '_tkinter'

pi@raspberrypi:~/Desktop $ python --version Python 3.5.2

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bobvann/GPIOSim/issues/4#issuecomment-252537928, or mute the thread https://github.com/notifications/unsubscribe-auth/AK0hRGqZ6I0schKQDZEXG6LO7nTdkC4sks5qycTUgaJpZM4KR9Qu.

bobvann avatar Oct 10 '16 16:10 bobvann

I want to use GPIOSim to simulate GPIO outputs for testing purposes without using physical circuits. Is there other usage. Please tell me. I changed tkinter to Tkinter in the GPIOSim.py file. Still same problem, but the error little bit different

Traceback (most recent call last):
File "GPIOSim.py", line 18, in 
from Tkinter import Tk, Canvas, Frame, BOTH, Menu, Label, PhotoImage
ImportError: No module named 'Tkinter'

lastimam avatar Oct 10 '16 18:10 lastimam

it is meant to be used on a computer. On the Raspberry it may create problems since RPi.GPIO already exists.

the purpose is to provide RPi.GPIO on your workstation.

In fact, if you’re using GPIOSim via ssh on a headless RPi, Tkinter does not exist as it is a library to create GUIs.

Il giorno 10 ott 2016, alle ore 20:53, lastimam [email protected] ha scritto:

I want to use GPIOSim to simulate GPIO outputs for testing purposes without using physical circuits. Is there other usage. Please tell me. I changed tkinter to Tkinter in the GPIOSim.py file. Still same problem, but the error little bit different

Traceback (most recent call last): File "GPIOSim.py", line 18, in from Tkinter import Tk, Canvas, Frame, BOTH, Menu, Label, PhotoImage ImportError: No module named 'Tkinter' — You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bobvann/GPIOSim/issues/4#issuecomment-252710953, or mute the thread https://github.com/notifications/unsubscribe-auth/AK0hRKDlAc2E3GM23aEkcbj1cHU7_M59ks5qyom4gaJpZM4KR9Qu.

bobvann avatar Oct 10 '16 19:10 bobvann

Did you run it on your workstation and solved the problem?

bobvann avatar Oct 13 '16 07:10 bobvann

Currently I don't have linux OS. I will let you know once I achieve. Thank you for following up

lastimam avatar Oct 13 '16 09:10 lastimam

My workstation os is centos6.5 ,i had installed python 3.5.1 ok,but when I run python import tkinter,it was prompt configured error,need help,tkx

ivanchen276 avatar Oct 15 '16 16:10 ivanchen276

Is there anyone else can help me to fix this problem?God help me

ivanchen276 avatar Oct 16 '16 15:10 ivanchen276

Please post complete error.

Also install tkinter and tk-devel on your machine

bobvann avatar Oct 17 '16 07:10 bobvann

I use rpm command to check the tkinter installed ok or not rpm -q tcl tcl-8.4.13-4.el5 rpm -q tk tk-8.4.13-5.el5_1.1 When I run module file import tkinter,it show no module named tkinter I found the tkinter path is /usr/local/Python-3.5.1/Lib/tkinter
Does this means tkinter installed ok Could you give me your mail address then i will post the error pics

ivanchen276 avatar Oct 17 '16 09:10 ivanchen276

When using python3 you must include Tkinter, not tkinter.... Note the Uppercase T

Il giorno 17 ott 2016, alle ore 11:53, ivanchen276 [email protected] ha scritto:

I use rpm command to check the tkinter installed ok or not rpm -q tcl tcl-8.4.13-4.el5 rpm -q tk tk-8.4.13-5.el5_1.1 When I run module file import tkinter,it show no module named tkinter I found the tkinter path is /usr/local/Python-3.5.1/Lib/tkinter

Does this means tkinter installed ok Could you give me your mail address then i will post the error pics

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

bobvann avatar Oct 17 '16 10:10 bobvann

Hello, I have the same problem on python 3.4, and could solved it by install some missing modules: sudo apt install python3-tk python3-pil

And remove line: from PIL import Image,ImageTk

I hope this could help you.

PedroAmorim avatar Oct 18 '16 16:10 PedroAmorim