Skip site navigation (1) Skip section navigation (2)

import error undefined symbol: PyUnicodeUCS2_Decode

From: Jason Horning <jason(dot)horning(at)bullberrysystems(dot)com>
To: "psycopg(at)postgresql(dot)org" <psycopg(at)postgresql(dot)org>
Subject: import error undefined symbol: PyUnicodeUCS2_Decode
Date: 2012-01-16 16:39:19
Message-ID: (view raw or whole thread)
Lists: psycopg
I'm trying to port a Python app from Ubuntu to CentOS 5.5.  When I try to import psycopg2, I get this:

ImportError: /usr/lib/python2.6/site-packages/psycopg2/ undefined symbol: PyUnicodeUCS2_Decode

My code is built against python 2.6 and python 2.6 is installed on the CentOS machine, but it's not the default Python.  (CentOS becomes very unhappy if I try to make 2.6 the default.)

I downloaded and extracted psycopg2 version 2.4.4 from have performed the following steps:

python26 build
python26 install

Hoping to get lucky, I replaced the file on the CentOS box with the _psycopg2 from my (working) Ubuntu machine.  That just got me another error:

ImportError: can't import mx.DateTime module

Python 2.6 seems to have been compiled with UCS4, and I am building
psycopg2 against 2.6, but when I do that it still seems to be looking for a UCS2 symbol.

Am I missing a step somewhere?


psycopg by date

Next:From: Daniele VarrazzoDate: 2012-01-16 17:10:18
Subject: Re: import error undefined symbol: PyUnicodeUCS2_Decode
Previous:From: Jacek KaƂuckiDate: 2012-01-16 13:53:37
Subject: Re: Fetching query result problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group