[redland-dev] python bindings . Unable to find Redland import.ImportError: "No module named Redland "

Dave Beckett dave at dajobe.org
Wed Feb 16 17:53:50 CET 2011


It is failing on the redland berkeleydb/sleepycatdb/whatever oracle call it
storage: 'bdb' which is optional and probably was not built when you
configured librdf.  The summary at the end of configure reports what it has
found and what it will build.

Everyone should look at the configure summary rather than just typing make &
make install after ;)

You can store triples in one of the other storages.  The others available
totally depend on your system and how librdf was configured. 'memory',
'file' and 'uri' are always available.

http://librdf.org/docs/api/redland-storage-modules.html

Dave

On 2/16/11 12:37 AM, Iraklis wrote:
> The compilation of the example.py was succefull.But i got this after running
> the redlandtest.py
> home at home-PC ~/red
> $ python redlandtest.py
> ............EEE..........
> ======================================================================
> ERROR: testListnessContext (__main__.RedlandModelCase)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "redlandtest.py", line 16, in setUp
>     options_string="hash-type='bdb',contexts='no',dir='/tmp',new='yes'")
>   File "/home/home/redland-bindings-1.0.13.1/python/RDF.py", line 1526, in
> __init__
>     raise RedlandError("Creating Storage failed")
> RedlandError: 'Creating Storage failed'
> 
> ======================================================================
> ERROR: testListnessNoContext (__main__.RedlandModelCase)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "redlandtest.py", line 16, in setUp
>     options_string="hash-type='bdb',contexts='no',dir='/tmp',new='yes'")
>   File "/home/home/redland-bindings-1.0.13.1/python/RDF.py", line 1526, in
> __init__
>     raise RedlandError("Creating Storage failed")
> RedlandError: 'Creating Storage failed'
> 
> ======================================================================
> ERROR: testSync (__main__.RedlandModelGeneral)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "redlandtest.py", line 262, in setUp
>     self.storage = HashStorage("test", options="hash-type='bdb'")
>   File "/home/home/redland-bindings-1.0.13.1/python/RDF.py", line 1552, in
> __init__
>     options_string = options)
>   File "/home/home/redland-bindings-1.0.13.1/python/RDF.py", line 1526, in
> __init__
>     raise RedlandError("Creating Storage failed")
> RedlandError: 'Creating Storage failed'
> 
> ----------------------------------------------------------------------
> Ran 25 tests in 0.084s
> 
> FAILED (errors=3)
> 
> Is it something i have to worry if i wanted to create a simple python script
> for parsing and then storing an rdf model in ntriples format?
> thank you
> 
> 
> On 15 February 2011 20:55, Dave Beckett <dave at dajobe.org
> <mailto:dave at dajobe.org>> wrote:
> 
>     The contents are different but the suffix for shared libraries is very
>     system dependent, especially with language bindings, even moreso with
>     python.  There are many configure options for this and I added a bunch
>     more in bindings 1.0.13.1 <http://1.0.13.1>:
>      http://librdf.org/bindings/INSTALL.html
> 
>     I forgot to CC: this to redland-dev, maybe you can follow up to your
>     email with the answer so people can find it.
> 
>     Dave
> 
> 
>     On Tue, 15 Feb 2011, Iraklis wrote:
> 
>         Yes i did it and it worked!!!!I did it after 3 weeks of efforts!!!!!!
>         (The only difference of windows shared libraries and unix based shared
>         libraries is the file extention?The structure of the lib is the same?)
> 
>         On 15 February 2011 19:14, Dave Beckett <dave at dajobe.org
>         <mailto:dave at dajobe.org>> wrote:
>              I don't use cygwin but I'm guessing since it is Windows it does
>              not use .so files but uses DLLs.  Have you tried renaming
>              Redland.so to redland.dll ?
> 
>              Dave
> 
> 
>         On Tue, 15 Feb 2011, Iraklis wrote:
> 
>              After all,i installed redland library under cygwin.I tried
>              to run te
>              example.py for the python bindings and i am getting an
>              error from
>              pythonabout the unknown Redland import from RDF.py : 
>              home at home-PC ~/redland-bindings-1.0.13.1/python/test
>              $ python test.py
>              Traceback (most recent call last):
>                File "test.py", line 23, in <module>
>                  import RDF
>                File "/usr/lib/python2.6/site-packages/RDF.py", line
>              126, in <module>
>                  import Redland
>              ImportError: No module named Redland
> 
>              I run the below to check the sys,path of python: 
>              home at home-PC ~/redland-bindings-1.0.13.1/python/test
>              $ python
>              Python 2.6.5 (r265:79063, Jun 12 2010, 17:07:01)
>              [GCC 4.3.4 20090804 (release) 1] on cygwin
>              Type "help", "copyright", "credits" or "license" for more
>              information.
>              >>> import sys
>              >>> sys.path
>              ['', '/usr/lib/python26.zip', '/usr/lib/python2.6',
>              '/usr/lib/python2.6/plat-cygwin',
>              '/usr/lib/python2.6/lib-tk',
>              '/usr/lib/python2.
>              6/lib-old', '/usr/lib/python2.6/lib-dynload',
>              '/usr/lib/python2.6/site-packages']
> 
>              Under '/usr/lib/python2.6/site-packages i can find
>              Redland.so.I guess python
>              is not able to find the imported file but the path is
>              being set correctly.
>              I have also set PYTHONPATH and LD_LIBRARY_PATH with the
>              value of
>              "'/usr/lib/python2.6/site-packages" according to the
>              documentation http://librdf.org/docs/python.html.
>              Any suggestions?
> 
> 
> 
> 
> 
> 
> _______________________________________________
> redland-dev mailing list
> redland-dev at lists.librdf.org
> http://lists.librdf.org/mailman/listinfo/redland-dev



More information about the redland-dev mailing list