Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I attempted to update Python on my CentOS 5.6 VM and have encountered some issues afterward. Initially, yum wouldn't work, but I have resolved that.

However, now I am unable to access the Network Configuration section under setup.

When I do select this option, I see this at the command line:

[root@crmpicco ~]# setup
Traceback (most recent call last):
  File "/usr/sbin/system-config-network-tui", line 9, in <module>
    from snack import *
ImportError: No module named snack

Line 9 on that file is this:

from snack import *

I'm not familiar with Python (I'm a PHP developer), so I'm not sure where to go with this or how to fix it.

This is what I have installed relating to Python:

[root@crmpicco ~]# yum list installed | grep python
MySQL-python.x86_64                      1.2.1-1                       installed
audit-libs-python.x86_64                 1.7.18-2.el5                  installed
dbus-python.x86_64                       0.70-9.el5_4                  installed
gamin-python.x86_64                      0.1.7-8.el5                   installed
gnome-python2.x86_64                     2.16.0-1.fc6                  installed
gnome-python2-bonobo.x86_64              2.16.0-1.fc6                  installed
gnome-python2-canvas.x86_64              2.16.0-1.fc6                  installed
gnome-python2-gnomevfs.x86_64            2.16.0-1.fc6                  installed
libselinux-python.x86_64                 1.33.4-5.7.el5                installed
libxml2-python.x86_64                    2.6.26-        installed
libxslt-python.x86_64                    1.1.17-2.el5_2.2              installed
mod_python.x86_64                        3.2.8-3.1                     installed
python.x86_64                            2.4.3-43.el5                  installed
python-devel.i386                        2.4.3-43.el5                  installed
python-devel.x86_64                      2.4.3-43.el5                  installed
python-elementtree.x86_64                1.2.6-5                       installed
python-iniparse.noarch                   0.2.3-4.el5                   installed
python-libs.x86_64                       2.4.3-43.el5                  installed
python-numeric.x86_64                    23.7-2.2.2                    installed
python-sqlite.x86_64                     1.1.7-1.2.1                   installed
python-urlgrabber.noarch                 3.1.0-6.el5                   installed
python26.x86_64                          2.6.8-2.el5                   installed
python26-libs.x86_64                     2.6.8-2.el5                   installed
rpm-python.x86_64                              installed

Also, it would seem I am now on Python 2.6.8.

python --version gives me Python 2.6.8

share|improve this question
it looks like you iunstall python but not the module used by setup. What gives you the command : yum list installed | grep python ? and how do you updated your python version ? – Kiwy Jun 27 '14 at 10:50
@Kiwy I have updated the question to include which Python packages I have installed. I can't find in my history how I installed Python, but to fix yum it I had to point to /usr/bin/python instead of /usr/bin/python2.4 (or whatever version it updated to). Any idea how to resolve this? Thanks. – crmpicco Jun 27 '14 at 10:57
As you've discovered, Python is absolutely central to Red Hat derived Linuxes. I would recommend not upgrading it, short of upgrading the whole OS. The whole idea behind a "stable" Linux like CentOS is that you use it as a stable platform to build something else on top of. That means leaving the platform untouched, in the same way that you don't try to change your house's foundation after you build the house. – Warren Young Jun 27 '14 at 11:31
@WarrenYoung Sadly it's a bit late for that as I have changed it. Do you know how to revert or fix this issue? – crmpicco Jun 27 '14 at 12:37
Go to a directory containing the distribution packages, then rpm -ivh --force *python*. That's probably a bit heavy-handed, but it's a faster path back to a working system than trying to get it working with an unsupported version of Python. – Warren Young Jun 27 '14 at 13:13

The error is complaining about missing a specific python module (library):

ImportError: No module named snack

On my Debian, snack.py is provided by the python-newt package. A quick search of the CentOS repositories suggests that this is called newt-python in CentOS. So, try installing that:

yum install newt-python
share|improve this answer
Thanks, but this gives me Setting up Install Process. No package newt-python available. Nothing to do. Where can I find what repo this is part of? I should point out i'm on CentOS 5.6. Everything online suggests this is CentOS 6 and above. – crmpicco Jun 27 '14 at 12:36
yum search newt ? – Kiwy Jun 27 '14 at 12:59
@crmpicco sorry, I don't use CentOS. Try kiwy's suggestion above, that should help you locate the package if it exists. – terdon Jun 27 '14 at 13:11
@Kiwy Thanks, I had already tried a yum search but that only brought up perl and devel modules. I assume the python version is part of another repo - but I have no idea which one. Is it for CentOS 6 only? – crmpicco Jun 27 '14 at 13:38
@terdon It would seem it is part of another repo (that I don't have). Would you know how I could locate this? – crmpicco Jun 27 '14 at 13:39

To fix this on my CentOS 5.6 installation I did the following:

wget http://vault.centos.org/5.6/os/x86_64/CentOS/python-2.4.3-43.el5.x86_64.rpm
rpm -ivh --force python-2.4.3-43.el5.x86_64.rpm
share|improve this answer

My suggestion, is to reinstall all library in version 2.6 and maybe uninstall python 2.4 but I'm not sure about that part.
The problem is now you have Python 2.6 installed and probably use by default, while you have almost none of the following libraries for python 2.6 (that were installed for python 2.4:


I suggest you to either remove python 2.6 (but that's probably not what you want, either install all those missing library for python 2.6 like this:

yum install libselinux-python26.x86_64 
yum install libxml2-python26.x86_64    
yum install libxslt-python26.x86_64    
yum install mod_python26.x86_64        
yum install python26.x86_64            
yum install python26-devel.i386        
yum install python26-devel.x86_64      
yum install python26-elementtree.x86_64
yum install python26-iniparse.noarch   
yum install python26-libs.x86_64       
yum install python26-numeric.x86_64    
yum install python26-sqlite.x86_64     
yum install python26-urlgrabber.noarch 

I can't warranty the success of such an installation, but that's the spirit. because python 2.6 miss the library aka module in python to work correctly.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.