undefined symbol: PyUnicodeUCS2_FromUnicode

E

Eric Moors

/home/me>redhat-config-services

Traceback (most recent call last):
File "/usr/share/redhat-config-services/serviceconf.py", line 26, in ?
import gtk
File "/usr/lib/python2.2/site-packages/rhpl/__init__.py", line 43, in ?
# dummy __init__ so that things work
File "/usr/lib/python2.2/ihooks.py", line 397, in import_module
q, tail = self.find_head_package(parent, name)
File "/usr/lib/python2.2/ihooks.py", line 433, in find_head_package
q = self.import_it(head, qname, parent)
File "/usr/lib/python2.2/ihooks.py", line 486, in import_it
m = self.loader.load_module(fqname, stuff)
File "/usr/lib/python2.2/ihooks.py", line 268, in load_module
m = self.hooks.load_dynamic(name, filename, file)
File "/usr/lib/python2.2/site-packages/gtk-2.0/ltihooks.py", line 51, in
load_dynamic
return ihooks.Hooks.load_dynamic(self, name, filename, file)
File "/usr/lib/python2.2/ihooks.py", line 172, in load_dynamic
return imp.load_dynamic(name, filename, file)
ImportError: /usr/lib/python2.2/site-packages/gtk-2.0/gtk/_gtk.so: undefined
symbol: PyUnicodeUCS2_FromUnicode

I got the above problem after trying to install Pythonol on my (redhat 9)
system, and for that I installed (IIRC) pygtk. Probably also some other
dependencies. I just don't know anymore, because I did not immediately
notice this problem. However after a while I noticed the redhat-config
scripts could no longer be launched. Then I found out the problem pasted
above was causing that.

After noticing this I have reinstalled every python related package on my
system I could find, but this problem won't go away. I have no clue where
to look and what to do to fix this problem.

I am absolutely clueless when it comes to python, so I probably shouldn't
have messed with it (I had no idea python was so frequently used). But now
that just means I have no idea where to look or what to do next to get this
problem solved. Is there anyone who has an idea as to what is wrong and how
it can be solved? It is driving me crazy, and I'd hate to reinstall my
system just to get this fixed.

Eric
 
D

Daniel Dittmar

Eric said:
/home/me>redhat-config-services
ImportError: /usr/lib/python2.2/site-packages/gtk-2.0/gtk/_gtk.so: undefined
symbol: PyUnicodeUCS2_FromUnicode

Python on RedHat 9 is compiled with 4 byte unicode characters (UCS4), most
other distributions use 2 byte unicode characters (UCS2). So if you install
a rpm compiled on a different system, this error is bound to happen.
Solution: compile the python module from source, but this requires that the
sources of the module have been prepared to deal with UCS4.

Daniel
 
E

Eric Moors

Daniel said:
Python on RedHat 9 is compiled with 4 byte unicode characters (UCS4), most
other distributions use 2 byte unicode characters (UCS2). So if you
install a rpm compiled on a different system, this error is bound to

I have installed mandrake's synaptic, but that is replaced, and maybe some
fedora core rpms. The rest are RH9 dedicated RPMS or compiled at my machine

Just checked, the only fedora core RPM I had was for wine. I removed it,
just to be sure. No change (None expected)
happen. Solution: compile the python module from source, but this requires
that the sources of the module have been prepared to deal with UCS4.

Thanks, but...
Which module? Is this a gtk thing? (The name does suggest this)
but `rpm -qf _gtk.so` shows that _gtk.so doesn't belong to any package.
Yet gtk is installed by rpm.

Aargh. So this is probably something I installed from a tarball.

I can remove it manually (and _gtk.la), but then the program fails with:

Fatal Python error: could not import pango
/usr/share/redhat-config-services/redhat-config-services: line 4: 13918
Aborted /usr/bin/python
/usr/share/redhat-config-services/serviceconf.py


It must probably also possible to trace this back, but I am severly lacking
python knowledge to do this. Any pointers?

Eric
 
D

Daniel Dittmar

Eric said:
Thanks, but...
Which module? Is this a gtk thing? (The name does suggest this)
but `rpm -qf _gtk.so` shows that _gtk.so doesn't belong to any
package. Yet gtk is installed by rpm.

From
ImportError: /usr/lib/python2.2/site-packages/gtk-2.0/gtk/_gtk.so: undefined
symbol: PyUnicodeUCS2_FromUnicode

I would guess that _gtk.so contains the python bindings to GTK.
PyUnicodeUCS2_FromUnicode is a function that belongs to the Python API.
Perhaps it's best to ask on the PyGTK mailing list on how to install it on
RedHat 9 (http://www.daa.com.au/~james/software/pygtk/).

I don't have much experience with RedHat myself, but from what I've heard on
this mailing list, it could be a good idea to install a second python for
your own programs and leave the system python alone.

Daniel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,060
Latest member
BuyKetozenseACV

Latest Threads

Top