|
From: Santtu P. <ja...@ra...> - 2003-12-28 18:18:08
|
I'm having disturbing problems with PostgreSQL 7.3.4, Python 2.3.3 and
pyPgSQL 2.4 on Gentoo Linux. PostgreSQL is emerged and has its
includes, libs etc. in standard places, and is working AFAIK. Python
2.3 is installed from sources under /usr/local and there's Gentoo's
standard Python (2.2.3) installation in the usual place. Now I'm
trying to install pyPgSQL to /usr/local.
The install script builds and installs the package without errors,
however giving lots of warnings about redefining _POSIX_C_SOURCE. The
pyPgSQL module can be imported into Python but it does not seem to
contain the objects I think it should have - only the __ things are
there. libpq can be imported but it doesn't have anything
useful. Then, if I try to import PgSQL, Python crashes with a
segmentation fault. Somebody please check the attached outputs, there
are some really weird and disturbing things around...
Is anyone else experiencing this, and is there a way around?
Some outputs:
oryx pypgsql # python2.3 setup.py build
/usr/local/lib/python2.3/distutils/dist.py:213: UserWarning: 'licence' distribution option is deprecated; use 'license'
warnings.warn(msg)
running build
running build_py
creating build
creating build/lib.linux-i686-2.3
creating build/lib.linux-i686-2.3/pyPgSQL
copying pyPgSQL/__init__.py -> build/lib.linux-i686-2.3/pyPgSQL
copying pyPgSQL/PgSQL.py -> build/lib.linux-i686-2.3/pyPgSQL
creating build/lib.linux-i686-2.3/pyPgSQL/libpq
copying pyPgSQL/libpq/__init__.py -> build/lib.linux-i686-2.3/pyPgSQL/libpq
running build_ext
building 'pyPgSQL.libpq.libpqmodule' extension
creating build/temp.linux-i686-2.3
creating build/temp.linux-i686-2.3/port
gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include -I/usr/include/postgresql -I/usr/include/pgsql -I../../../../../ -I/usr/local/include/python2.3 -c pgnotify.c -o build/temp.linux-i686-2.3/pgnotify.o
In file included from /usr/local/include/python2.3/Python.h:8,
from pgnotify.c:51:
/usr/local/include/python2.3/pyconfig.h:847:1: warning: "_POSIX_C_SOURCE" redefined
In file included from /usr/include/string.h:26,
from pgnotify.c:47:
/usr/include/features.h:171:1: warning: this is the location of the previous definition
gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include -I/usr/include/postgresql -I/usr/include/pgsql -I../../../../../ -I/usr/local/include/python2.3 -c pgconnection.c -o build/temp.linux-i686-2.3/pgconnection.o
In file included from /usr/local/include/python2.3/Python.h:8,
from pgconnection.c:93:
/usr/local/include/python2.3/pyconfig.h:847:1: warning: "_POSIX_C_SOURCE" redefined
In file included from /usr/include/string.h:26,
from pgconnection.c:89:
/usr/include/features.h:171:1: warning: this is the location of the previous definition
...
other objects compiled similarly
...
gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include -I/usr/include/postgresql -I/usr/include/pgsql -I../../../../../ -I/usr/local/include/python2.3 -c pgversion.c -o build/temp.linux-i686-2.3/pgversion.o
In file included from /usr/local/include/python2.3/Python.h:8,
from pgversion.c:97:
/usr/local/include/python2.3/pyconfig.h:847:1: warning: "_POSIX_C_SOURCE" redefined
In file included from /usr/include/string.h:26,
from pgversion.c:91:
/usr/include/features.h:171:1: warning: this is the location of the previous definition
gcc -pthread -shared build/temp.linux-i686-2.3/libpqmodule.o build/temp.linux-i686-2.3/pgboolean.o build/temp.linux-i686-2.3/pgint2object.o build/temp.linux-i686-2.3/pgint8object.o build/temp.linux-i686-2.3/pgversion.o build/temp.linux-i686-2.3/pglargeobject.o build/temp.linux-i686-2.3/pgnotify.o build/temp.linux-i686-2.3/pgconnection.o build/temp.linux-i686-2.3/pgresult.o build/temp.linux-i686-2.3/pymemstrdup.o build/temp.linux-i686-2.3/port/strtoll.o build/temp.linux-i686-2.3/port/strtoull.o build/temp.linux-i686-2.3/port/strtok.o -L/usr/lib -lpq -o build/lib.linux-i686-2.3/pyPgSQL/libpq/libpqmodule.so
oryx pypgsql # python2.3 setup.py install
/usr/local/lib/python2.3/distutils/dist.py:213: UserWarning: 'licence' distribution option is deprecated; use 'license'
warnings.warn(msg)
running install
running build
running build_py
running build_ext
running install_lib
creating /usr/local/lib/python2.3/site-packages/pyPgSQL
copying build/lib.linux-i686-2.3/pyPgSQL/__init__.py -> /usr/local/lib/python2.3/site-packages/pyPgSQL
copying build/lib.linux-i686-2.3/pyPgSQL/PgSQL.py -> /usr/local/lib/python2.3/site-packages/pyPgSQL
creating /usr/local/lib/python2.3/site-packages/pyPgSQL/libpq
copying build/lib.linux-i686-2.3/pyPgSQL/libpq/__init__.py -> /usr/local/lib/python2.3/site-packages/pyPgSQL/libpq
copying build/lib.linux-i686-2.3/pyPgSQL/libpq/libpqmodule.so -> /usr/local/lib/python2.3/site-packages/pyPgSQL/libpq
byte-compiling /usr/local/lib/python2.3/site-packages/pyPgSQL/__init__.py to __init__.pyc
byte-compiling /usr/local/lib/python2.3/site-packages/pyPgSQL/PgSQL.py to PgSQL.pyc
byte-compiling /usr/local/lib/python2.3/site-packages/pyPgSQL/libpq/__init__.py to __init__.pyc
oryx pypgsql # python2.3
Python 2.3.3 (#1, Dec 26 2003, 18:29:55)
[GCC 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r3, propolice)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyPgSQL import libpq
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "pyPgSQL/libpq/__init__.py", line 23, in ?
from libpq import *
ImportError: No module named libpq
>>> from pyPgSQL import PgSQL
Segmentation fault
oryx pypgsql # python2.3
Python 2.3.3 (#1, Dec 26 2003, 18:29:55)
[GCC 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r3, propolice)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyPgSQL
>>> dir(pyPgSQL)
['__builtins__', '__doc__', '__file__', '__name__', '__path__', '__version__']
>>> from pyPgSQL import libpq
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "pyPgSQL/libpq/__init__.py", line 23, in ?
from libpq import *
ImportError: No module named libpq
>>> dir(pyPgSQL)
['__builtins__', '__doc__', '__file__', '__name__', '__path__', '__version__', 'libpq']
>>> from pyPgSQL import libpq
>>> dir(libpq)
['__builtins__', '__doc__', '__file__', '__name__', '__path__']
>>> dir(pyPgSQL.libpq)
['__builtins__', '__doc__', '__file__', '__name__', '__path__']
>>> libpq.PQconnect
Traceback (most recent call last):
File "<stdin>", line 1, in ?
AttributeError: 'module' object has no attribute 'PQconnect'
>>> from pyPgSQL import PgSQL
Segmentation fault
Versions:
oryx pypgsql # uname -a
Linux oryx 2.6.0-test11-oryx03 #1 Sat Nov 29 20:22:08 EET 2003 i686 Celeron (Mendocino) GenuineIntel GNU/Linux
oryx pypgsql # gcc --version
gcc (GCC) 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r3, propolice)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
oryx pypgsql # psql --version
psql (PostgreSQL) 7.3.4
contains support for command-line editing
oryx pypgsql # python2.3 -V
Python 2.3.3
oryx pypgsql # head README
:Version: #ident "@(#) $Id: README,v 1.32 2003/07/14 21:35:57 ballie01 Exp $"
----------------------------------------------------------------------------
pyPgSQL - v2.4: Python DB-API 2.0 Compliant Interface Module for PostgreSQL.
----------------------------------------------------------------------------
===============================
0. Copyright notice and License
===============================
pyPgSQL, version 2.4
--
-- Santtu "Japsu" Pajukanta
-- ja...@ra...
"Economics is extremely useful as a form of employment for
economists.", -John Kenneth Galbraith
|