[redland-dev] Re: Redland: Problem With Python-Bindings

Sean B. Palmer sean+redn at infomesh.net
Thu Aug 12 02:05:09 BST 2004


(Summary: still not quite fully working.)

[...]
> Seems plausible.  So you are running your own compile of python as 
> well as BDB.

I was on the old system: it seemed a good idea to have more recent
stuff, even though the documentation says that Redland can use any BDB
from v.2 onwards. Certainly Python needed upgrading anyway.

> Never tried with python 2.4 (is it released?).  Typo?

Python 2.4 alpha-2 was released [1] on the 5th August. It has some
fairly nice features, e.g. builtin sets, without being particularly
revolutionary--but I'd best not get started on that.

[...]
> The librdf0 in the debian archive *is* the latest (0.9.18) but *will
> not* work with the python2.3-librdf in the debian archive (0.9.16) 
> due to internal changes and additions like the query api.

Whoops; that was my misunderstanding. I've now done the following per
your instructions:

# tail -2 /etc/apt/sources.list
deb http://www.redland.opensource.ac.uk/dist/binaries/debian/ ./
deb-src http://www.redland.opensource.ac.uk/dist/binaries/debian/ ./
# aptitude update
# aptitude install librdf0 librdf-dev python2.3-librdf

I searched for the installed example.py file to test the installation,
but when I found it it turned out that it didn't have access to the data
that it wanted:

    $ python /usr/share/doc/python2.3-librdf/examples/example.py
    found statement: {[http://purl.org/net/dajobe/],
    [http://purl.org/dc/elements/1.1/creator], "Dave Beckett"}
    Parsing URI (file) ../data/dc.rdf
    Traceback (most recent call last):
      File "/usr/share/doc/python2.3-librdf/examples/example.py",
       line 59, in ?
        for s in parser.parse_as_stream(uri,uri):
    TypeError: iteration over non-sequence

Which I fixed by copying over the material from my old downloaded
redland-bindings package:

# cd /usr/share/doc/python2.3-librdf/examples
# rsync -avz ~/redland-bindings-0.9.18.1/data/ ../data

But then, alas, it gave me a very familiar error:

    $ python example.py
    [...]
    Querying for dc:titles:
    Traceback (most recent call last):
      File "example.py", line 71, in ?
        for result in q.run_as_bindings(model):
    AttributeError: 'Query' object has no attribute 'run_as_bindings'

This is what I got when I had it running with Python 2.4 and the library
path hacks on debian stable, so I guessed that the problem must be the
same, and sure enough ldd gives the same (lesser amount of) undefined
symbols. Here's the full output:

$ ldd -d /usr/lib/python2.3/site-packages/Redland.so
         librdf.so.0 => /usr/lib/librdf.so.0 (0x40014000)
      librasqal.so.0 => /usr/lib/librasqal.so.0 (0x4003b000)
      libraptor.so.1 => /usr/lib/libraptor.so.1 (0x4004c000)
      libcurl.so.3 => /usr/lib/libcurl.so.3 (0x4006a000)
      libidn.so.11 => /usr/lib/libidn.so.11 (0x4009a000)
      libssl.so.0.9.7 => /usr/lib/i686/cmov/libssl.so.0.9.7 (0x400ca000)
      libcrypto.so.0.9.7 => /usr/lib/i686/cmov/libcrypto.so.0.9.7
                            (0x400fb000)
      libdl.so.2 => /lib/tls/libdl.so.2 (0x401f9000)
      libz.so.1 => /usr/lib/libz.so.1 (0x401fc000)
      libxml2.so.2 => /usr/lib/libxml2.so.2 (0x4020d000)
      libpthread.so.0 => /lib/tls/libpthread.so.0 (0x40308000)
      libm.so.6 => /lib/tls/libm.so.6 (0x40317000)
      libdb3.so.3 => /usr/lib/libdb3.so.3 (0x4033a000)
      libmysqlclient.so.12 => /usr/lib/libmysqlclient.so.12 (0x403e5000)
      libcrypt.so.1 => /lib/tls/libcrypt.so.1 (0x40425000)
      libnsl.so.1 => /lib/tls/libnsl.so.1 (0x40451000)
      libc.so.6 => /lib/tls/libc.so.6 (0x40466000)
      libdb-4.2.so => /usr/lib/libdb-4.2.so (0x405a1000)
      /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
undefined symbol: _Py_NoneStruct
    (/usr/lib/python2.3/site-packages/Redland.so)
undefined symbol: PyString_Type
    (/usr/lib/python2.3/site-packages/Redland.so)
undefined symbol: PyExc_TypeError
    (/usr/lib/python2.3/site-packages/Redland.so)
undefined symbol: PyInt_Type
    (/usr/lib/python2.3/site-packages/Redland.so)
undefined symbol: PyType_Type
    (/usr/lib/python2.3/site-packages/Redland.so)
undefined symbol: PyExc_NameError
    (/usr/lib/python2.3/site-packages/Redland.so)

I wondered if aptitude had somehow managed to get itself confused by
getting an earlier version again, but the following refutes that idea:

# dpkg -l | grep -i redland
ii  librdf0        0.9.18-2       Redland RDF Application Framework
ii  librdf0-dev    0.9.18-2       Redland RDF library development [...]
ii  python2.3-libr 0.9.18.1-1     Python 2.3 language bindings [...]

The modules there corresponding directly to the ones contained in your
/dist/binaries/debian/ path.

I just have the standard python and bdbs now I'm running unstable:

ii  libdb3         3.2.9-20       Berkeley v3 Database Libraries
ii  libdb4.2       4.2.52-16      Berkeley v4.2 Database Libraries
ii  python         2.3.4-1        An interactive high-level [...]
ii  python2.3      2.3.4-8        An interactive high-level [...]

So again I have a partially working system. Many thanks for your swift
help the first time around: it's a shame it didn't quite resolve the
problem though. Any more ideas?

Cheers,

[1] http://www.python.org/2.4/

-- 
Sean B. Palmer, http://inamidst.com/



More information about the redland-dev mailing list