duplicity-talk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Duplicity-talk] 0.4.6: setup.py install with --prefix not working


From: Kenneth Loafman
Subject: Re: [Duplicity-talk] 0.4.6: setup.py install with --prefix not working
Date: Fri, 07 Dec 2007 08:04:20 -0600
User-agent: Thunderbird 1.5.0.14pre (X11/20071023)

Kenneth Loafman wrote:
> Andreas Schildbach wrote:
>> Hi Kenneth,
>>
>> I was just trying Duplicity 0.4.6 when I ran into the very same problem
>> I had with 0.4.3:
>>
>> # python setup.py install --prefix=~/duplicity
>> [...]
>>
>> # ~/duplicity/bin/duplicity --version
>> duplicity 0.4.2
>>
>> The version number stems from the Debian package, which is installed in
>> parallel (if that package is missing, a file not found error will be
>> displayed instead).
>>
>> Please have a look at thread "Duplicity 0.4.4.RC3 Ready". We identified
>> the path to the site packages as the culprit. Those need to be adapted
>> by setup.py to the prefixed directory. Should I file this as a bug?
> 
> I'll go ahead and file it with you on the CC list.  It's a lot easier to
> keep track of that way.

It turns out not to be a bug after all, just a 'feature' of Python.  The
following commands will extract, install, and execute duplicity in the
user's choice of path.

$ cd ~
$ tar xzf duplicity-0.4.7.tar.gz
$ cd duplicity-0.4.7
$ python setup.py install --prefix=~/duplicity
$ export PYTHONPATH='/home/ken/duplicity/lib/python2.4/site-packages/'
$ duplicity/bin/duplicity -V
duplicity 0.4.7

I was able to use tilde in a couple of places, but PYTHONPATH needs the
full pathname.  Python hard codes the path to the system libraries at
compile time, so you need to use environment variables to change it.  In
the case of PYTHONPATH, the path is prepended to sys.path and this is
what allows us to find the newer version instead of the installed
version of duplicity.

I am certain this could be implemented in the code, but there are all
sorts of considerations to make it a general case that would work on all
the distros and versions we have to handle.

...Ken

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]