tkinter installation - 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: tkinter installation (/thread-26227.html) |
tkinter installation - arbiel - Apr-24-2020 Hi I failed installing tkinter python -m pip install tkinter Defaulting to user installation because normal site-packages is not writeable ERROR: Could not find a version that satisfies the requirement tkinter (from versions: none) ERROR: No matching distribution found for tkinterWhat shall I do ? Arbiel RE: tkinter installation - Jeff900 - Apr-24-2020 I tried it too and got the same error message. Anyway, import tkinter is not a problem in the Python shell in my case. Have you already tried to import the module? It may be already installed. RE: tkinter installation - Larz60+ - Apr-24-2020
is automatically installed with most python versions try simple app: import tkinter as tk def simple_app(parent): parent.title("It's alive!") if __name__ == '__main__': root = tk.Tk() simple_app(root) root.mainloop() RE: tkinter installation - arbiel - Apr-25-2020 Hi Larz60+ The OS is Ubuntu 16.04, and Python : 3.8.0 (I'll include this information into my signature) Before asking for help, I tried Arbiel
RE: tkinter installation - Larz60+ - Apr-25-2020 tkinter is included with python 3.8. make sure environment variables are set correctly, run: python -V do you see python 3.8? RE: tkinter installation - arbiel - Apr-25-2020 remi@remi-Vostro-3550:~$ python -V Python 3.8.0 remi@remi-Vostro-3550:~$ python Python 3.8.0 (default, Oct 28 2019, 16:14:01) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path ['', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/home/remi/.local/lib/python3.8/site-packages', '/usr/local/lib/python3.8/dist-packages', '/usr/lib/python3/dist-packages'] >>> exit() remi@remi-Vostro-3550:~$ for rep in '/usr/lib/python38.zip' '/usr/lib/python3.8' '/usr/lib/python3.8/lib-dynload' '/home/remi/.local/lib/python3.8/site-packages' '/usr/local/lib/python3.8/dist-packages' '/usr/lib/python3/dist-packages'; do echo "${rep}"; ls -1 "${rep}" | grep tk; done /usr/lib/python38.zip ls: impossible d'accéder à '/usr/lib/python38.zip': Aucun fichier ou dossier de ce type /usr/lib/python3.8 /usr/lib/python3.8/lib-dynload /home/remi/.local/lib/python3.8/site-packages /usr/local/lib/python3.8/dist-packages /usr/lib/python3/dist-packages pygtkcompat remi@remi-Vostro-3550:~$So, should I reinstall Python ? Arbiel RE: tkinter installation - Larz60+ - Apr-25-2020 reinstall seems like a viable option. follow snippsat's guide here: https://python-forum.io/Thread-Part-1-Linux-Python-3-environment RE: tkinter installation - arbiel - Apr-26-2020 Hi Larz60+ Reinstalling Python was not exactly the best option. In fact, on Unix-like systems, tkinter is not included in Python, but through Python's extensions. I got aware of this after having reinstalled Python-3.8.2, and failed. The way to go is explained the Python Developer's Guide. RE: tkinter installation - Larz60+ - Apr-26-2020 glad to hear all is well. |