Hi Siddharth,
> I'm trying to install python2.3 on my redhat9 system. the redhat 9 comes
> with python2.2.2 pre-installed. The docs say that installing python2.3
> alongside is not an issue, so I did. I got the src rpm and did the usual.
> On trying to run the python script I wanted to, it croaked saying the
> following:
> ImportError: No module named libxml2
>
> I did a whereis and found this:
> libxml2: /usr/lib/libxml2.a /usr/lib/libxml2.la /usr/lib/libxml2.so
> /usr/include/libxml2
>
The ImportError you see above is an error caused when one tries to import a 
python module which is not present in the default module search path for 
python.
    In your case, the python script you mentioned seems to be trying to import 
the module 'libxml2'. Now, a python module is not the same as a C library 
file. That's the reason why you get the error inspite of having the files 
> libxml2: /usr/lib/libxml2.a /usr/lib/libxml2.la /usr/lib/libxml2.so
> /usr/include/libxml2

I guess you kinda fugured that out:
> Then I figured, perhaps the bindings have to be installed, so I ran
> up2date and got the latest greatest python xml binding rpms and installed
> them.
well, so now the question is where did it go if you installed it ??

Since now you have two python installations, you would have two directories 
in /usr/lib (something like /usr/lib/python2.2 and /usr/lib/python2.3). Find 
out where in these two direcctories is the file 'libxml2.py'. Depending on 
that here are your options (I'm assuming you find it under the python2.2 
directory): 
- execute the script with the corresponding python version, that is:
    - either execute the script like so: $ python22 myscript.py
    - or make this the first line of the script.
        #!/usr/bin/python22
- Create a link in the direcotory '/etc/alternatives/' pointing to the correct 
version of python:
    ln -sf /usr/bin/python22 /etc/alternatives/python
- Uninstall python-2.3 and then *upgrade* to it instead :
     rpm -Uvh python-2.3<whatever>.rpm
   This should be safe since python usually maintains backward compatibily, so 
any existing apps that run on python2.2 should still run on python2.3.

HTH
Regards
Steve

BTW: I have 5 gmail ids to give. Make me laugh and I'll give ya one :o)

-- 
        Once, when the secrets of science were the jealously guarded property
of a small priesthood, the common man had no hope of mastering their arcane
complexities.  Years of study in musty classrooms were prerequisite to
obtaining even a dim, incoherent knowledge of science.
        Today all that has changed: a dim, incoherent knowledge of science is
available to anyone.
                -- Tom Weller, "Science Made Stupid"
--
______________________________________________________________________
Pune GNU/Linux Users Group Mailing List:      ([EMAIL PROTECTED])
List Information:  http://plug.org.in/mailing-list/listinfo/plug-mail
Send 'help' to [EMAIL PROTECTED] for mailing instructions.

Reply via email to