Обсуждение: 2.4.2: undefined symbol: lo_truncate

Поиск
Список
Период
Сортировка

2.4.2: undefined symbol: lo_truncate

От
Matthew Robinson
Дата:
Warning, a python neophyte here so I am more than likely missing something. 

I'm trying to use 2.4.2 (and also tried 2.4.1 with same error, 2.4.0 with a different error...) under Ubuntu with the intention of trying out ReviewBoard.

launching python and attempting to import psycopg2 yields:
--------
>>> import psycopg2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.6/
dist-packages/psycopg2/__init__.py", line 67, in <module>
    from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: /usr/local/lib/python2.6/dist-packages/psycopg2/_psycopg.so: undefined symbol: lo_truncate
>>>

My setup.cfg:
-------
[build_ext]
define=PSYCOPG_EXTENSIONS,PSYCOPG_NEW_BOOLEAN,HAVE_PQFREEMEM
use_pydatetime=1
#static_libpq=1
pg_config=/usr/bin/pg_config

Output of /usr/bin/pg_config:
-----
# /usr/bin/pg_config
BINDIR = /usr/lib/postgresql/8.4/bin
DOCDIR = /usr/share/doc/postgresql
HTMLDIR = /usr/share/doc/postgresql
INCLUDEDIR = /usr/include/postgresql
PKGINCLUDEDIR = /usr/include/postgresql
INCLUDEDIR-SERVER = /usr/include/postgresql/8.4/server
LIBDIR = /usr/lib
PKGLIBDIR = /usr/lib/postgresql/8.4/lib
LOCALEDIR = /usr/share/locale
MANDIR = /usr/share/postgresql/8.4/man
SHAREDIR = /usr/share/postgresql/8.4
SYSCONFDIR = /etc/postgresql-common
PGXS = /usr/lib/postgresql/8.4/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--build=i486-linux-gnu' '--prefix=/usr' '--includedir=/usr/include' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--libexecdir=/usr/lib/postgresql-8.4' '--disable-maintainer-mode' '--disable-dependency-tracking' '--disable-silent-rules' '--srcdir=.' '--mandir=/usr/share/postgresql/8.4/man' '--with-docdir=/usr/share/doc/postgresql-doc-8.4' '--sysconfdir=/etc/postgresql-common' '--datadir=/usr/share/postgresql/8.4' '--bindir=/usr/lib/postgresql/8.4/bin' '--includedir=/usr/include/postgresql/' '--enable-nls' '--enable-integer-datetimes' '--enable-thread-safety' '--enable-debug' '--disable-rpath' '--with-tcl' '--with-perl' '--with-python' '--with-pam' '--with-krb5' '--with-gssapi' '--with-openssl' '--with-libxml' '--with-libxslt' '--with-ldap' '--with-ossp-uuid' '--with-gnu-ld' '--with-tclconfig=/usr/lib/tcl8.5' '--with-tkconfig=/usr/lib/tk8.5' '--with-includes=/usr/include/tcl8.5' '--with-system-tzdata=/usr/share/zoneinfo' '--with-pgport=5432' 'CFLAGS=-g -O2 -g -Wall -O2 -fPIC' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,--as-needed' 'build_alias=i486-linux-gnu' 'CPPFLAGS='
CC = gcc
CPPFLAGS = -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/tcl8.5
CFLAGS = -g -O2 -g -Wall -O2 -fPIC -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fwrapv -g
CFLAGS_SL = -fpic
LDFLAGS = -Wl,-Bsymbolic-functions -Wl,--as-needed -Wl,--as-needed
LDFLAGS_SL =
LIBS = -lpgport -lxslt -lxml2 -lpam -lssl -lcrypto -lkrb5 -lcom_err -lgssapi_krb5 -lz -lreadline -lcrypt -ldl -lm
VERSION = PostgreSQL 8.4.8
----
Building (python setup.py install) this yields no warnings or errors.


The easy_install psycopg2 has the same error. If I attempt to install with static libraries, I can't even build it:
.....
running build_ext
Traceback (most recent call last):
  File "setup.py", line 555, in <module>
    ext_modules=ext)
  File "/usr/lib/python2.6/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/lib/python2.6/distutils/dist.py", line 975, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.6/distutils/dist.py", line 995, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.6/distutils/command/install.py", line 615, in run
    self.run_command('build')
  File "/usr/lib/python2.6/distutils/cmd.py", line 333, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python2.6/distutils/dist.py", line 995, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.6/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/usr/lib/python2.6/distutils/cmd.py", line 333, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python2.6/distutils/dist.py", line 994, in run_command
    cmd_obj.ensure_finalized()
  File "/usr/lib/python2.6/distutils/cmd.py", line 117, in ensure_finalized
    self.finalize_options()
  File "setup.py", line 367, in finalize_options
    self.link_objects.append(
AttributeError: 'NoneType' object has no attribute 'append'

In case it matters:
# cat /proc/version
Linux version 2.6.32-32-generic-pae (buildd@roseapple) (gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) ) #62-Ubuntu SMP Wed Apr 20 22:10:33 UTC 2011
# python --version
Python 2.6.5
# python-config --libs
-lpthread -ldl -lutil -lm -lpython2.6



Any ideas?

Thanks in advance for any insight you can provide!


Matthew Robinson
Applications Engineer
Computing & Information Technology Services
University of Massachusetts Dartmouth

Claire T. Carney Library, Room 309
285 Old Westport Road
North Dartmouth, MA  02747
tel: 508.999.8119
fax: 508.999.8162
email/aim: mrobinson@umassd.edu
----
CITS will never ask you for your password or other confidential information via email.  Beware of phishing scams where email and/or malicious web sites try to trick users into entering their username and password.  For more information about password security please visit: http://www.umassd.edu/cits/security/

Re: 2.4.2: undefined symbol: lo_truncate

От
Daniele Varrazzo
Дата:
On Thu, Oct 6, 2011 at 3:33 PM, Matthew Robinson
<matthew.robinson@umassd.edu> wrote:
> Warning, a python neophyte here so I am more than likely missing something.
>
> I'm trying to use 2.4.2 (and also tried 2.4.1 with same error, 2.4.0 with a
> different error...) under Ubuntu with the intention of trying out
> ReviewBoard.
>
> launching python and attempting to import psycopg2 yields:
> --------
>>>> import psycopg2
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/usr/local/lib/python2.6/
> dist-packages/psycopg2/__init__.py", line 67, in <module>
>     from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
> ImportError: /usr/local/lib/python2.6/dist-packages/psycopg2/_psycopg.so:
> undefined symbol: lo_truncate

lo_truncate is available after postgres 8.3. Psycopg is being compiled
again libpq 8.4, so the function is included. Looks like at runtime it
tries to dynamically link with an older libpq: you can check with ldd
which one.

-- Daniele