mx19.2 python & tkinter - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: GUI (https://python-forum.io/forum-10.html) +--- Thread: mx19.2 python & tkinter (/thread-29187.html) |
mx19.2 python & tkinter - gonzo01 - Aug-22-2020 i have python installed on mx 19.2 from xterm bill@mx:~ $ python -V Python 2.7.16 bill@mx:~ $ python3 -V Python 3.7.3 bill@mx:~ bill@mx:~ $ whereis python python: /usr/bin/python2.7 /usr/bin/python3.7 /usr/bin/python3.7m /usr/bin/python /usr/lib/python2.7 /usr/lib/python3.7 /usr/lib/python2.6 /etc/python2.7 /etc/python3.7 /etc/python /usr/local/lib/python2.7 /usr/local/lib/python3.7 /usr/include/python2.7 /usr/include/python3.7m /usr/share/python /usr/share/man/man1/python.1.gz bill@mx:~ $ bill@mx:~ $ sudo apt install python3.7 python3-tk Reading package lists... Done Building dependency tree Reading state information... Done python3-tk is already the newest version (3.7.3-1). python3.7 is already the newest version (3.7.3-2+deb10u2). python3.7 set to manually installed. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. bill@mx:~ if i run a script dloaded from the net in geaney i get import tkinter as tk ImportError: No module named tkinter help please RE: mx19.2 python & tkinter - gonzo01 - Aug-23-2020 re: import tkinter as tkinter ImportError: No module named tkinter apt list | grep python3-tk and then python3 -m tkinter ie bill@mx:~ $ apt list | grep python3-tk WARNING: apt does not have a stable CLI interface. Use with caution in scripts. python3-tk/oldstable,now 3.5.3-1 amd64 [installed] python3-tk-dbg/oldstable 3.5.3-1 amd64 python3-tksnack/oldstable,oldstable 2.2.10.20090623-dfsg-6 all bill@mx:~ $ python3 -m tkinter bill@mx:~ why does this show tkinter to be installed yet a script that includes import tkinter etc fails? thanks RE: mx19.2 python & tkinter - Axel_Erfurt - Aug-23-2020 You have multiple versions of python3 Look at the folder /usr/lib/python3.7/ is there a tkinter folder ? RE: mx19.2 python & tkinter - gonzo01 - Aug-23-2020 thanks Axel i have both python 2.7 and 3.5 installed user/lib3.5 includes tkinter but not usr/lib/python2.5 can i uninstall 2.5 to fix the problem? thanks RE: mx19.2 python & tkinter - Axel_Erfurt - Aug-23-2020 No, I mean python3 only. What is the output of ls /usr/lib/ | grep python
RE: mx19.2 python & tkinter - gonzo01 - Aug-23-2020 thanks for the quick reply as requested bill@mx:~ $ ls /usr/lib/ | grep python libpyglib-2.0-python2.7.so.0 libpyglib-2.0-python2.7.so.0.0.0 python2.6 python2.7 python3 python3.5 bill@mx:~ thanks again RE: mx19.2 python & tkinter - gonzo01 - Aug-27-2020 ok ive managed to get 1 script dloaded from the web to run by opening a terminal and entering python3 /path-to-file/file-name.py but this does not work with other examples plus i am unable to run same script from geany/idle/thonny/glade etc |