2

I am having trouble with this problem. I want to connect to sybase using python3.3. But error occurs when I enter the code:

import sybpydb

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /opt/sybase/OCS-15_0/python/python31_64r/lib/sybpydb.so: undefined symbol: PyUnicodeUCS2_Decode

I hope anyone can help me get rid of this....

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Kris Edison
  • 109
  • 1
  • 4
  • 12

2 Answers2

3

The C extension you have there works only with Python 3.1.

Python 3.3 has an updated Unicode architecture, and the PyUnicodeUCS2_Decode function no longer exists in that version.

You'll need to find a version specifically for Python 3.3 or compile your own.

Because the C API has changed in this respect, it may be that the extension needs to be updated to work with Python 3.3; you'll need to contact the authors of the extension about this.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
0

You have to recompile python with ./configure --enable-shared --prefix=$HOME/Python27 --enable-unicode=ucs4

Follow Update new Django and Python 2.7.* with virtualenv on Dreamhost (with passenger)

Community
  • 1
  • 1
James
  • 13,571
  • 6
  • 61
  • 83