Index: [Article Count Order] [Thread]

Date:  Tue, 9 Oct 2007 12:10:34 -0500
From:  "Gerald Waugh" <gwaugh (at mark) frontstreetnetworks.com>
Subject:  [coba-e:10847] Re: Python/Yum Import RPM Error
To:  <coba-e (at mark) bluequartz.org>
Message-Id:  <93f001c80a97$51ac3980$0601a8c0@systemax>
In-Reply-To:  <349568420710090915u4237c675jbd7c62a4decf2891 (at mark) mail.gmail.com>
X-Mail-Count: 10847

> > > > My Yum stopped working it seems to break when "import rpm"
> > > is executed
> > > > in python. In Python I manually did "import rpm" and 
> this is what 
> > > > I got.
> > > >
> > > > [root@c2raq4 ~]# python
> > > > Python 2.3.4 (#1, May  2 2007, 19:26:00)
> > > > [GCC 3.4.6 20060404 (Red Hat 3.4.6-8)] on linux2
> > > > Type "help", "copyright", "credits" or "license" for more
> > > information.
> > > > >>> import rpm
> > > > Traceback (most recent call last):
> > > >   File "<stdin>", line 1, in ?
> > > > ImportError: AttributeError: cannot open shared object
> > > file: No such
> > > > file or directory
> > > > >>>
> > > >
> > > > I am not sure where the problem lies.
> > > >
> > > > Also:
> > > > [root (at mark) c2raq4 ~]# rpm -q rpm-python rpm-python-4.3.3-22_nonptl
> > > >
> > > > Do I need to reinstall RPM or Python? How do I fix this?
> > > >
> > > > I searched the archives and google, but didnt find anything.
> > >
> > >
> > > I am new to Python, so not exactly sure how the syntax 
> works or what 
> > > the errors mean. It seems that all the "imports" 
> attributes have a 
> > > .py and .pyc file. I searched my python dir for rpm.py* but didnt 
> > > find anything. Did this file somehow get removed? Am I 
> supposed to 
> > > have it? The only RPM related files I have are:
> > >
> > > /usr/lib/python2.3/distutils/command/bdist_rpm.py.bdist-rpm
> > > /usr/lib/python2.3/distutils/command/bdist_rpm.py
> > > /usr/lib/python2.3/distutils/command/bdist_rpm.pyc
> > > /usr/lib/python2.3/distutils/command/bdist_rpm.pyo
> > >
> > > /usr/lib/python2.3/site-packages/rpmmodule.so
> > > /usr/lib/python2.3/site-packages/rpmdb/*
> > > /usr/lib/python2.3/site-packages/rpmUtils/*
> > >
> > > Line 21 in /usr/lib/python2.3/site-packages/yum/__init__.py
> > > reads "import rpm"
> > >
> > > I dont have any rpm.py* files.
> > >
> > > If anyone can please provide some insight.
> > >
> > On a BQ server runing "locate rpm | grep python" I get;
> >
> > [root@fsn3 CBQ]# locate rpm | grep python 
> > /usr/lib/python2.3/distutils/command/bdist_rpm.py.bdist-rpm
> > /usr/lib/python2.3/distutils/command/bdist_rpm.py
> > /usr/lib/python2.3/distutils/command/bdist_rpm.pyc
> > /usr/lib/python2.3/distutils/command/bdist_rpm.pyo
> > /usr/lib/python2.3/lib-dynload/grpmodule.so
> > /usr/lib/python2.3/site-packages/rpmdb
> > /usr/lib/python2.3/site-packages/rpmdb/__init__.py
> > /usr/lib/python2.3/site-packages/rpmdb/_rpmdb.so
> > /usr/lib/python2.3/site-packages/rpmdb/db.py
> > /usr/lib/python2.3/site-packages/rpmdb/dbobj.py
> > /usr/lib/python2.3/site-packages/rpmdb/dbrecio.py
> > /usr/lib/python2.3/site-packages/rpmdb/dbshelve.py
> > /usr/lib/python2.3/site-packages/rpmdb/dbtables.py
> > /usr/lib/python2.3/site-packages/rpmdb/dbutils.py
> > /usr/lib/python2.3/site-packages/rpmmodule.so
> > /usr/lib/python2.3/site-packages/rpmUtils
> > /usr/lib/python2.3/site-packages/rpmUtils/__init__.pyc
> > /usr/lib/python2.3/site-packages/rpmUtils/__init__.py
> > /usr/lib/python2.3/site-packages/rpmUtils/arch.pyc
> > /usr/lib/python2.3/site-packages/rpmUtils/arch.py
> > /usr/lib/python2.3/site-packages/rpmUtils/miscutils.py
> > /usr/lib/python2.3/site-packages/rpmUtils/miscutils.pyc
> > /usr/lib/python2.3/site-packages/rpmUtils/oldUtils.py
> > /usr/lib/python2.3/site-packages/rpmUtils/oldUtils.pyc
> > /usr/lib/python2.3/site-packages/rpmUtils/transaction.py
> > /usr/lib/python2.3/site-packages/rpmUtils/transaction.pyc
> > /usr/lib/python2.3/site-packages/rpmUtils/updates.py
> > /usr/lib/python2.3/site-packages/rpmUtils/updates.pyc
> > /usr/lib/rpm/brp-python-bytecompile
> >
> > Maybe see what is there?
> >
> > Gerald Waugh
> 
> Thanks Gerald, I got all those files you mentioned, plus I 
> got the following with that command:
> 
> /var/cache/yum/update/packages/python-2.3.4-14.3.i386.rpm
> /var/cache/yum/base/headers/rpm-python-4.3.3-18_nonptl.i386.hdr
> /var/cache/yum/base/headers/rpm-python-4.3.3-22_nonptl.i386.hdr
> /var/cache/yum/base/packages/rpm-python-4.3.3-18_nonptl.i386.rpm
> /var/cache/yum/base/packages/python-urlgrabber-2.9.8-2.noarch.rpm
> /var/cache/yum/base/packages/python-sqlite-1.1.7-1.2.i386.rpm
> /var/cache/yum/base/packages/python-elementtree-1.2.6-4.2.1.i386.rpm
> /var/cache/yum/base/packages/rpm-python-4.3.3-22_nonptl.i386.rpm
> /var/cache/yum/base/packages/python-sqlite-1.1.7-1.2.1.i386.rpm
> /var/cache/yum/base/packages/python-2.3.4-14.4.i386.rpm
> /var/cache/yum/base/packages/python-elementtree-1.2.6-5.el4.ce
> ntos.i386.rpm
> /var/cache/yum/base/packages/libxml2-python-2.6.16-10.i386.rpm
> 
> Does this mean that these files have yet to be installed?
> 

[root@fsn3 ~]# yum list | grep python
dbus-python.i386                         0.22-12.EL.9
installed
libxml2-python.i386                      2.6.16-10
installed
python.i386                              2.3.4-14.4
installed
python-elementtree.i386                  1.2.6-5.el4.centos
installed
python-sqlite.i386                       1.1.7-1.2.1
installed
python-urlgrabber.noarch                 2.9.8-2
installed
rpm-python.i386                          4.3.3-22_nonptl
installed

yum list | grep python
Should show what is installed. (see above)

Have you tried "yum install python"
What installer did you use "NuOnce or Strongbolt"

Gerald


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.