How To Install Python3-tk In Centos?
Solution 1:
tkinter is available in coreos as tkinter
package. You can install it with
sudo yum install tkinter
Once it is done, you can import and use it as usual.
>>>import tkinter>>>tkinter._test()
For Python 3, you can install it with
sudo yum install python3-tkinter
As some users mentioned, it is available as python36u-tkinter
or python34-tkinter
depending on OS.
sudo yum install python34-tkinter
sudo yum install python36u-tkinter
Solution 2:
In Centos 7 you can use:
yum install python36-tkinter
Solution 3:
I solved the same problem using these two commands 100%
sudo yum -y update
sudo yum -y install python36u-tkinter
Solution 4:
Try the following command.
sudo yum install python3-tkinter
Now Test in your terminal:
>>>import tkinter>>>tkinter._test()
Solution 5:
I believe tk come with python by default. If so, have you look to reinstall your python 3.4. (I prefer ver3.5). Procedures are mentioned in this website.
Steps:
Download python version
wget https://www.python.org/ftp/python/3.5.3/Python-3.5.3.tar.xz
Install decoding tool if you don't have:
sudo yum install xz-libs
- Decode the xz encodeing
xz -d Python-3.5.3.tar.xz
- Uncompress the decoded file
tar -xvf Python-3.5.3.tar
- Move the desired directory to install python
cd Python-3.5.3
- Configure python file
./configure
- Build using
make
- Install using
make altinstall
- Check if tkinter works. A tk window should pop out. Open a terminal and type the following:
python3.5
import tkinter as tk
root = tk.Tk()
The website also has other instructions for installing setuptools
and pip
which are very useful.
Post a Comment for "How To Install Python3-tk In Centos?"