468,512 Members | 1,640 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,512 developers. It's quick & easy.

undefined symbol: PyUnicodeUCS2_FromUnicode

/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
Jul 18 '05 #1
4 14318
Eric Moors wrote:
/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

Jul 18 '05 #2
Daniel Dittmar wrote:
Eric Moors wrote:
/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


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
Jul 18 '05 #3
Eric Moors wrote:
Daniel Dittmar wrote:
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.


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

Jul 18 '05 #4
> 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/).


Thanks, I'll do that. I realized I was off-topic here, but didn't know of a
better place to go.

Eric
Jul 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by pervinder | last post: by
8 posts views Thread by Scott J. McCaughrin | last post: by
2 posts views Thread by el prinCipante | last post: by
8 posts views Thread by pavan734 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.