Installing Tkinter for Python 2.7

Issues related to applications and software problems
Post Reply
Posts: 2
Joined: 2014/07/03 21:04:22

Installing Tkinter for Python 2.7

Post by njgudman » 2014/07/03 21:37:40

I've setup my system with an alternative installation of python, specifically python 2.7.7. I need to install Tkinter for python 2.7. Unfortunately when using YUM to install Tkinter, it installs it for the default python installation of python 2.6. So far I've tried to install an RPM for Tkinter for python 2.7 that I found here: ... 4.rpm.html.
When trying to install this RPM I get this:

Code: Select all

[stall@dhcp215169 Downloads]$ sudo yum install tkinter-2.7.7-2mgc30.x86_64.rpm
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base:
 * epel:
 * extras:
 * updates:
Setting up Install Process
Examining tkinter-2.7.7-2mgc30.x86_64.rpm: tkinter-2.7.7-2mgc30.x86_64
Marking tkinter-2.7.7-2mgc30.x86_64.rpm as an update to tkinter-2.6.6-52.el6.x86_64
Resolving Dependencies
--> Running transaction check
---> Package tkinter.x86_64 0:2.6.6-52.el6 will be updated
--> Processing Dependency: tkinter = 2.6.6-52.el6 for package: python-tools-2.6.6-52.el6.x86_64
---> Package tkinter.x86_64 0:2.7.7-2mgc30 will be an update
--> Processing Dependency: python = 2.7.7-2mgc30 for package: tkinter-2.7.7-2mgc30.x86_64
--> Finished Dependency Resolution
Error: Package: tkinter-2.7.7-2mgc30.x86_64 (/tkinter-2.7.7-2mgc30.x86_64)
           Requires: python = 2.7.7-2mgc30
           Installed: python-2.6.6-52.el6.x86_64 (@CentOS-6-x86_64-updates)
               python = 2.6.6-52.el6
           Available: python-2.6.6-51.el6.x86_64 (CentOS-6-x86_64-os)
               python = 2.6.6-51.el6
Error: Package: python-tools-2.6.6-52.el6.x86_64 (@CentOS-6-x86_64-updates)
           Requires: tkinter = 2.6.6-52.el6
           Removing: tkinter-2.6.6-52.el6.x86_64 (@CentOS-6-x86_64-updates)
               tkinter = 2.6.6-52.el6
           Updated By: tkinter-2.7.7-2mgc30.x86_64 (/tkinter-2.7.7-2mgc30.x86_64)
               tkinter = 2.7.7-2mgc30
           Available: tkinter-2.6.6-51.el6.x86_64 (CentOS-6-x86_64-os)
               tkinter = 2.6.6-51.el6
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
Knowing that this problem is due to the default installation of python being python 2.6, I temporarily changed the python symbolic link from python 2.6 to python 2.7. However when I tried again to install the RPM with YUM, I get this:

Code: Select all

[stall@dhcp215169 Downloads]$ sudo yum install tkinter-2.7.7-2mgc30.x86_64.rpm
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   No module named yum

Please install a package which provides this module, or
verify that the module is installed correctly.

It's possible that the above module doesn't match the
current version of Python, which is:
2.7.7 (default, Jul  3 2014, 10:44:55) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)]
How can I install Tkinter for my python 2.7 installation?

User avatar
Forum Moderator
Posts: 27732
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Installing Tkinter for Python 2.7

Post by TrevorH » 2014/07/04 00:32:56

So you've discovered the hard way that you cannot and should not replace the system python with a different version! A lot of Redhat tools including yum depend on the exact version of python that ships with the distro so you cannot change it.

You've also discovered that downloading random RPMs for different distros doesn't work either :-(

The IUS Community repo packages python 2.7 as python27* packages that install alongside the system python and do not replace it. They also haev a tkinter27 package which may be what you're looking for? They also have python32-tkinter.x86_64 python33-tkinter.x86_64 along with a bunch of other python3[23]* packages. Perhaps some of those might help?
CentOS 6 will die in November 2020 - migrate sooner rather than later!
CentOS 5 has been EOL for nearly 3 years and should no longer be used for anything!
Full time Geek, part time moderator. Use the FAQ Luke

Posts: 2
Joined: 2014/07/03 21:04:22

Re: Installing Tkinter for Python 2.7

Post by njgudman » 2014/07/07 18:22:42

Thank you, I didn't know about the IUS Community repo. I was able to get tkinter27 working after I removed the installation of python2.7 that I manually installed and installed python2.7 from the IUS repo.

Post Reply

Return to “CentOS 6 - Software Support”