4 ms·
Nooope, not on linux at least >>> import tkinter Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/pyth
by Topgamer7 5y ago
Nooope, not on linux at least
>>> import tkinter
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.9/tkinter/__init__.py", line 37, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: libtk8.6.so: cannot open shared object file: No such file or directory
- kbr2000 5y agoOn Debian GNU/Linux Tkinter is provided by the python-tk package (might differ in other distros).
- BiteCode_dev 5y agoI specifically stated "any windows or mac python program". Indeed, most linux distro packaging teams decided to split tk in a separate package that is not installed by default. Same for pip and setuptools. Of course, this made getting a congruent python experience extra hard, on a platform with already plenty of gotchas for python setup, but hey, they saved a few Mo.
- Zababa 5y agoI didn't know about pip and setuptools being separate packages. That explains some things.
- xcombelle 5y agoOf my understanding, tkinter is not in python packages because it needs an WM to run correctly
- BiteCode_dev 5y agoOh I understand the motivation. I also know it caused a lot of pain, for very little gain.
- Qem 5y agoManu Linux distributions have tclsh preinstalled.
- cafard 5y agoJust now: $ python3 Python 3.6.9 (default, Jan 26 2021, 15:33:00) [GCC 8.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import tkinter >>> tkinter.Tcl().eval('puts {hello, world}') hello, world '' >>> Ubuntu 18.04; but it's not on a machine running 20.04