Hi Lisa,

that RPM was obviously compiled against a different Python version (2.7 and probably with ucs4 as you already found out) and Postgres version (9.3, but you have 8.4, missing e.g. the PQescapeLiteral function).

Your options are:
- Get a proper RPM package for RHEL 6.5 if possible. But there may be only one for Pygres 3.8.1 which I don't recommend. - Try installing Python 2.7 with ucs4 format, and make sure you're using that one (/opt/Python/ with your version must be first in the PATH, I guess that was the problem) *and* also install Postgres 9.3. - Install the latest PyGreSQL from source with "python setup.py install". That's probably the best and easiest solution. You will need the Python-devel and Postgres-devel packages corresponding to your installed Python and Postgres packages to get it compiled.

-- Christoph


Am 15.12.2014 um 23:09 schrieb Lisa Martin:
Hi,
   I am porting to a new Red Hat system a PostgreSQL database that uses
and python & PyGreSQL module for connection, and I am having trouble
getting the PyGreSQL working. New system is Red Hat Enterprise Server
Rel 6.5. PostgreSQL is 8.4.20. I have Python 2.6.6 and Python 2.7.5 on
the system;  if I can get either version of Python to with the PyGreSQL
that would be great.  I have  PyGreSQL-4.1.1.-3.Fc22.x86-64.rpm.  I am
looking for guidance on path of least resistance (i.e. whichever Python
I can get it working with it faster). From my errors below, if someone
can guide me I best direction to take, I’d really appreciate it.
In Python 2.7 I get error:
import pgdb
Import Error:
/opt/Python/Python-2.7.5/lib/python2.7/site-pakages/_pg.so: undefined
symbol: PyUnicodeUCs$_AsLatin1String
I thought if I reinstalled Python 2.7.5 using “enable-unicode=ucs4” that
would fix the problem, but I still get the error message above after
reinstalling Python like this:
./configure –enable-shared  --enable-unicode=ucs4
–prefix=/opt/Python/Python-2.7.5
To see if I am at ucs2 or ucs4, I did:
import sys
print sys.maxunicode
65535
In Python 2.6 I get error:
import pgdb
Import Error: /usr/lib64/python2.6/site-packages/_pg.so: undefined
symbol: PQescapeLiteral
My Python 2.6 installation is ucs4, if that matters:
import sys
print sys.maxunicode
111411
I saw reference to setting “escaping-funcs=0” in archive (when using
PostgreSQL older than 9.x), but I am unsure if the .rpm I have already
has that update in it or not.  If not, I don’t see what file I would add
it to. If that is next step,  can someone point me to the file in .rpm
to update (or whatever other file)? Alas, prior Red Hat system was
already configured with all the software, so I didn’t have to install
any of the software on the old system.
-Lisa

_______________________________________________
PyGreSQL mailing list
[email protected]
https://mail.vex.net/mailman/listinfo.cgi/pygresql

Reply via email to