![]() What's going to happen when I upgrade to python 3.10. To accomplish the task, we use the pacman package manager, and run: sudo pacman -Sy tk. On Archlinux, to install Tkinter, we just have to pull in the tk package. Choose Python 3.8 option and check Python version again. sudo apt-get update & sudo apt-get install python3-tk. sudo update-alternatives -config python3. First, make sure you have python-support installed: sudo apt-get install python-support Then, run update-python-modules with the -a option to rebuild all the modules: sudo update-python-modules -a I cannot guarantee all your modules will build though, since there are some API changes between Python 2 and Python 3. Update default Python3 version by below command. Installing python3-tk package on Ubuntu is as easy as running the following command on terminal: sudo apt-get update sudo apt-get install python3-tk. This seems to have worked, in the sense that tkinter runs under python 3.9, but I need hardly say that I don't feel entirely comfortable with this. It looks like Python 3.8 is already installed but not set as default. For python 3.7 on ubuntu I had to use sudo apt-get install python3.7-tk to make it work. In /usr/lib/python3.8/lib-dynload and I copied it into /usr/lib/python3.9/lib-dynload replacing the "38" in the name with "39". yum install tkinter for python3 user, install python3-tk package by following command sudo apt-get install python3-tk tk-devel also needs to be installed in my case. I found a module named _tkinter.cpython-38-x86_64-linux-gnu.so This time, python told me no module named _tkinter. On inspection, all the files in /usr/lib/python/ were still empty, so I decided to copy all the scripts from python 3.8. ![]() I was able to import tkinter in python 3.9, by root=tkinter.Tk() failed. When trying install tkinter module, it seems to point to 3.6.9 version and failed: sudo apt-get install python3.6-tk Reading package lists. (Every file in the tkinter directory, so far as I can see.) Then dpkg-reconfigure ran with no errors, so I tried sudo apt install python3-tkĪgain, and I got the same message as above, telling me that the newest package was already installed. ![]() I made a tkinter directory and added empty files for each file that dpkg complained about. ![]() How can I get tkinter for python 3.9?Īs suggested by ubfan1, I tried dpkg-reconfigure python3-tkīut I got the error FileNotFoundError: No such file or directory: '/usr/lib/python3.9/tkinter/_init_.py' Python3-tk is already the newest version (3.8.10-0ubuntu1~20.04).Ġ upgraded, 0 newly installed, 0 to remove and 11 not upgraded. I get the message Note, selecting 'python3-tk' instead of 'python3.9-tk' I have just installed python 3.9, but it doesn't come with tkinter apparently. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |