Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Got undefined symbol: _PyUnicodeUCS2_AsDefaultEncodedString onOpenSuSE 11.1

Reply
Thread Tools

Got undefined symbol: _PyUnicodeUCS2_AsDefaultEncodedString onOpenSuSE 11.1

 
 
Alejandro Valdez
Guest
Posts: n/a
 
      09-25-2009
Hello I sent this e-mail to the python-help list but I'm not sure if
that list is active... so I post it again here:

I'm trying to build Python 2.6.2 from the sources downloaded from the
python official site on OpenSuSE 11.1 (32 bit). After installation the
python command line interpreter seems to run ok, but when I try to
install setuptools I get:

user@linux-ba2a:~/tmp> bash setuptools-0.6c9-py2.6.egg
--install-dir=/home/user/python/lib/python2.6/site-packages/
Traceback (most recent call last):
*File "<string>", line 1, in <module>
*File "/home/user/tmp/setuptools-0.6c9-py2.6.egg/setuptools/command/easy_install.py",
line 15, in <module>
*File "/home/user/tmp/setuptools-0.6c9-py2.6.egg/setuptools/sandbox.py",
line 1, in <module>
ImportError: /home/user/python/lib/python2.6/lib-dynload/operator.so:
undefined symbol: _PyUnicodeUCS2_AsDefaultEncodedString


To compile Python I executed:

../configure --prefix=/home/user/python
../make
../make install

The compile process seems to be ok, so I'm kind of clueless

Any ideas?
 
Reply With Quote
 
 
 
 
Mark Dickinson
Guest
Posts: n/a
 
      09-25-2009
On Sep 25, 7:05*pm, Alejandro Valdez <(E-Mail Removed)>
wrote:
> Hello I sent this e-mail to the python-help list but I'm not sure if
> that list is active... so I post it again here:
>
> I'm trying to build Python 2.6.2 from the sources downloaded from the
> python official site on OpenSuSE 11.1 (32 bit). After installation the
> python command line interpreter seems to run ok, but when I try to
> install setuptools I get:
> [...]
> To compile Python I executed:
>
> ./configure --prefix=/home/user/python
> ./make
> ./make install
>
> The compile process seems to be ok, so I'm kind of clueless
>
> Any ideas?


This is just a guess, but try configuring with:

../configure --enable-unicode=ucs4 --prefix=/home/user/python

On Linux, by default, a self-compiled Python uses UCS2
internally for its unicode support (with some support
for UTF16). Most Linux distributions, however, distribute
a Python that uses UCS4 (aka UTF32) instead, so it seems
possible that your setuptools egg is expecting to find a
UCS4 build.

Mark
 
Reply With Quote
 
 
 
 
Mark Dickinson
Guest
Posts: n/a
 
      09-25-2009
On Sep 25, 7:56*pm, Mark Dickinson <(E-Mail Removed)> wrote:
> On Sep 25, 7:05*pm, Alejandro Valdez <(E-Mail Removed)>
> wrote:
> > Hello I sent this e-mail to the python-help list but I'm not sure if
> > that list is active... so I post it again here:

>
> > I'm trying to build Python 2.6.2 from the sources downloaded from the
> > python official site on OpenSuSE 11.1 (32 bit). After installation the
> > python command line interpreter seems to run ok, but when I try to
> > install setuptools I get:
> > [...]
> > To compile Python I executed:

>
> > ./configure --prefix=/home/user/python
> > ./make
> > ./make install

>
> > The compile process seems to be ok, so I'm kind of clueless

>
> > Any ideas?

>
> This is just a guess, but try configuring with:
>
> ./configure --enable-unicode=ucs4 --prefix=/home/user/python
>
> On Linux, by default, a self-compiled Python uses UCS2
> internally for its unicode support (with some support
> for UTF16). *Most Linux distributions, however, distribute
> a Python that uses UCS4 (aka UTF32) instead, so it seems
> possible that your setuptools egg is expecting to find a
> UCS4 build.


Also, make sure that setuptools is picking up the right python2.6
executable: you want it to be using the one in /home/user/python/bin,
not the one in /usr/bin (or where-ever SuSE keeps its python).
What does 'which python2.6' give on your system, after the python
install
but before the setuptools install?

It may be necessary to set the PYTHONPATH environment variable too;
I'm not sure about this.

I admit I don't really understand how you could be getting an
undefined _PyUnicodeUCS2* symbol; undefined _PyUnicodeUCS4* would
make more sense.

Mark
 
Reply With Quote
 
Alejandro Valdez
Guest
Posts: n/a
 
      09-25-2009
Hello Mark, thank you a lot for your hints, I compiled python using
the --enable-unicode=ucs4 parameter in configure and I could
successfully install setuptools (Anyway I'm a little suspicious about
my compiled binaries...).

You are right about the environment variables, I have set PYTHONPATH
and PYTHONHOME to:
PYTHONPATH=$HOME/python/lib/python2.6/site-packages
PYTHONHOME=$HOME/python

The compiler issued some warnings, two of them (related to Unicode)
called my attention:

In file included from Python/formatter_unicode.c:13:
Python/../Objects/stringlib/formatter.h: In function
‘unknown_presentation_type’:
Python/../Objects/stringlib/formatter.h:35: warning: format ‘%c’
expects type ‘int’, but argument 3 has type ‘Py_UNICODE’

Should I ignore them?




Other warning messages:

libpython2.6.a(posixmodule.o): In function `posix_tmpnam':
/home/mailstat/Python-2.6.2/./Modules/posixmodule.c:7129: warning: the
use of `tmpnam_r' is dangerous, better use `mkstemp'
libpython2.6.a(posixmodule.o): In function `posix_tempnam':
/home/mailstat/Python-2.6.2/./Modules/posixmodule.c:7084: warning: the
use of `tempnam' is dangerous, better use `mkstemp'
/home/mailstat/Python-2.6.2/Modules/_struct.c:187: warning:
‘get_ulong’ defined but not used
/home/mailstat/Python-2.6.2/Modules/_cursesmodule.c: In function
‘PyCurses_getsyx’:
/home/mailstat/Python-2.6.2/Modules/_cursesmodule.c:1766: warning:
‘y’ may be used uninitialized in this function
/home/mailstat/Python-2.6.2/Modules/_cursesmodule.c:1766: warning:
‘x’ may be used uninitialized in this function

On Fri, Sep 25, 2009 at 3:56 PM, Mark Dickinson <(E-Mail Removed)> wrote:
> On Sep 25, 7:05*pm, Alejandro Valdez <(E-Mail Removed)>
> wrote:
>> Hello I sent this e-mail to the python-help list but I'm not sure if
>> that list is active... so I post it again here:
>>
>> I'm trying to build Python 2.6.2 from the sources downloaded from the
>> python official site on OpenSuSE 11.1 (32 bit). After installation the
>> python command line interpreter seems to run ok, but when I try to
>> install setuptools I get:
>> [...]
>> To compile Python I executed:
>>
>> ./configure --prefix=/home/user/python
>> ./make
>> ./make install
>>
>> The compile process seems to be ok, so I'm kind of clueless
>>
>> Any ideas?

>
> This is just a guess, but try configuring with:
>
> ./configure --enable-unicode=ucs4 --prefix=/home/user/python
>
> On Linux, by default, a self-compiled Python uses UCS2
> internally for its unicode support (with some support
> for UTF16). *Most Linux distributions, however, distribute
> a Python that uses UCS4 (aka UTF32) instead, so it seems
> possible that your setuptools egg is expecting to find a
> UCS4 build.
>
> Mark
> --
> http://mail.python.org/mailman/listinfo/python-list
>

 
Reply With Quote
 
Mark Dickinson
Guest
Posts: n/a
 
      09-27-2009
On Sep 25, 10:13*pm, Alejandro Valdez <(E-Mail Removed)>
wrote:

> The compiler issued some warnings, two of them (related to Unicode)
> called my attention:
>
> In file included from Python/formatter_unicode.c:13:
> Python/../Objects/stringlib/formatter.h: In function
> ‘unknown_presentation_type’:
> Python/../Objects/stringlib/formatter.h:35: warning: format ‘%c’
> expects type ‘int’, but argument 3 has type ‘Py_UNICODE’


I only see one warning here, not two. But it should definitely
be fixed.

>
> Should I ignore them?
>
> Other warning messages:
> [...]


I *think* all of these warnings are benign, though the source should
really be corrected if necessary to silence them (some of them, like
the _struct.c one, have already been fixed in svn). I'll take a
closer
look at them, though. Thanks for reporting these!

Mark
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Got "undefined method `split'" when installing gem dm-mysql-adapter Deche Pangestu Ruby 2 11-09-2010 01:34 PM
If you Got Questions? I bet We got Answers Leisure.201@gmail.com Javascript 1 04-28-2007 11:04 PM
typeof x == 'undefined' or x == undefined? -Lost Javascript 13 01-31-2007 12:04 AM
undefined vs. undefined (was: new Array() vs []) VK Javascript 45 09-12-2006 05:26 PM
undefined behavior or not undefined behavior? That is the question Mantorok Redgormor C Programming 70 02-17-2004 02:46 PM



Advertisments