Here is the temporary solution I've found for my case. Still looking for
better suggestions.
To recap, my problem is that by default, "python setup.py install" places
all files under
"/Library/Frameworks/Python.framework/Versions/Current/bin/". When I added
"--prefix=/usr" as a setup.py argument, the main executable is correctly
located under /usr/bin, but many python files to be imported are copied to a
newly created directory "/usr/lib/python2.5/site-packages". Then, when
python starts, the site module (http://docs.python.org/library/site.html)
adds the concatenation of sys.prefix and lib/python2.5/site-packages as well
as lib/site-python and adds those combinations to the path.

Unfortunately, sys.prefix is
"/Library/Frameworks/Python.framework/Versions/2.5", so the necessary
imports in "/usr/lib/python2.5/site-packages" are never found (didn't
research further, but this is probably a python compile time option).

I did two manual adjustments:

   - Moved necessary imports from "/usr/lib/python2.5/site-packages" to
   "/usr/lib/site-python" to remove the python version specificity. Let me know
   if there is any way to achieve this with setup.py.
   - Added "/usr/lib/site-python" to PYTHONPATH environment variable.

Pascal

On Sat, Apr 18, 2009 at 5:23 PM, Pascal Schaedeli <pascals_...@pobox.com>wrote:

> How to you instruct "setup.py install" to install all files under /usr
> instead of /Library/Frameworks/Python.framework/Versions/Current/bin/?
> I tried:
> python ./setup.py install --prefix=/usr --dry-run
> But it still attempts to create directories
> like /usr/lib/python2.5/site-packages
>
> I am trying to install "Duplicity", a backup tool using rsync and don't
> want it to be installed in the tree of a specific Python distribution in
> order to be able to upgrade or switch to another python version without
> affecting the availability of duplicity.
>
> Thanks.
> Pascal S.
>



-- 
pasc...@pobox.com
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to