[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Duplicity-talk] Can't find _librsync?
From: |
Scott Hannahs |
Subject: |
Re: [Duplicity-talk] Can't find _librsync? |
Date: |
Sun, 22 Nov 2009 18:37:46 -0500 |
On Nov 22, 2009, at 5:48 PM, Kenneth Loafman wrote:
> Scott Hannahs wrote:
>> Mac OS X 10.6 and Python 2.6
>>
>> I have beat my head on this a bit and seem not to be able to figure out why
>> duplicity can't find this library. Duplicity seems to be looking for the
>> library _librsync which as far as I can tell does not exist. This is called
>> from the librsync.py which does exist. When I run duplicity I get the
>> following traceback:
>>
>> % export PYTHONPATH=/usr/local/lib/python2.6/site-packages:/sw/lib/
>> % /usr/local/bin/duplicity --encrypt-key XXXXXXXX --sign-key YYYYYYYY
>> --gpg-options='--default-key=ZZZZZZZZ' $HOME/Documents/
>> file:///tmp/Documents/
>> Traceback (most recent call last):
>> File "/usr/local/bin/duplicity", line 41, in <module>
>> from duplicity import collections
>> File "/usr/local/lib/python2.6/site-packages/duplicity/collections.py",
>> line 29, in <module>
>> from duplicity import path
>> File "/usr/local/lib/python2.6/site-packages/duplicity/path.py", line 33,
>> in <module>
>> from duplicity import librsync
>> File "/usr/local/lib/python2.6/site-packages/duplicity/librsync.py", line
>> 37, in <module>
>> blocksize = _librsync.RS_JOB_BLOCKSIZE
>> NameError: name '_librsync' is not defined
>>
>> I have set the PYTHONPATH variable and if I check, it seems that /sw/lib is
>> in my path correctly if I print sys.path.
>>
>> At /sw/lib exist both librsync.a and librsync.dylib
>>
>> Just for completeness here is the build command for duplicity that I use to
>> reference the librsync that I installed with fink.
>>
>> sudo python setup.py install --prefix=/usr/local --librsync-dir=/sw
>
> Have you tried a normal install without specifying the prefix and
> librsync options? That should work. There are a lot of complications
> when trying to use other than the default Python install options, mainly
> with the PYTHONPATH settings. It's just not worth the hassle.
>
> In addition, to compile librsync correctly you will need the module
> librsync-dev from the repositories.
If I try without the options, then the build process can't find the librsync.h
file
_librsyncmodule.c:26:22: error: librsync.h: No such file or directory
Which is reasonable, since I installed my librsync and header files in
/sw/include and /sw/lib. I had used this build on an earlier version of
duplicity 0.5.X and it had worked.
If I just use the --librsync-dir=/sw option then it builds correctly and finds
all the libraries. It just can't seem to load it again at run time.
With PYTHONPATH="" it gives the error above. With PYTHONPATH set to all the
directories
PYTHONPATH=/usr/local/lib/python2.6/site-packages:/usr/local/lib/python2.6/site-packages/duplicity:/sw/lib
I get the NameError
NameError: name '_librsync' is not defined
If I just open python and manually load it, it is the same.
>>> import librsync
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.6/site-packages/duplicity/librsync.py", line 37,
in <module>
blocksize = _librsync.RS_JOB_BLOCKSIZE
NameError: name '_librsync' is not defined
>>>
If I manually try to load _librsync it complains about a missing link. So it
seems to find the file but has an error with _rs_file_copy_cb
>>> import _librsync
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError:
dlopen(/usr/local/lib/python2.6/site-packages/duplicity/_librsync.so, 2):
Symbol not found: _rs_file_copy_cb
Referenced from: /usr/local/lib/python2.6/site-packages/duplicity/_librsync.so
Expected in: flat namespace
in /usr/local/lib/python2.6/site-packages/duplicity/_librsync.so
>>>
So it seems that python can find the file after all, but the missing routine
error is causing it to skip the load step and continue on in the try/fail flow
structure with librsync.py
I am using version 0.9.7-1003 of librsync. Is this a problem?
Scott