msg102724 - (view) |
Author: Tim Kersten (timkersten) |
Date: 2010-04-09 15:15 |
$ python setup.py install --root=/tmp/ --prefix=/usr running install error: must supply either home or prefix/exec-prefix -- not both I believe that this should work. --root and --prefix are, from what I can tell, two unrelated options. |
|
|
msg102726 - (view) |
Author: Tarek Ziadé (tarek) *  |
Date: 2010-04-09 15:31 |
Those are mutually exclusive: --prefix : installation prefix --root: install everything relative to this alternate root directory root will install things into a completely alternate root and will use the existing installation scheme and make all paths relative to root. Whereas prefix allows you to define an alternate value for the installation sys.prefix. And supposes that this prefix is in your PYTHONPATH. IOW, having the two options makes it impossible for distutils to choose where to put some files. |
|
|
msg102728 - (view) |
Author: Tim Kersten (timkersten) |
Date: 2010-04-09 15:52 |
I fail to see how these are, or at least should be mutually exclusive. Upon reading your reply I would think that if one was to specify both a --prefix and --root that the prefix would be relative to the --root. i.e. --prefix changes the curront installation scheme as per usual i.e. --root specifies an alternative "root", but obeys the installation scheme in every other sense. i.e. (On linux) / => /path/to/alternative/root/ Any chance you could explain this further please? I'm having difficulties understanding why I'm wrong. |
|
|
msg102730 - (view) |
Author: Tarek Ziadé (tarek) *  |
Date: 2010-04-09 16:23 |
== prefix == With prefix, you need to make sure the target site-packages is in your PYTHONPATH: PYTHONPATH=/tmp/foo/lib/python2.6/site-packages/ python setup.py install --prefix=/tmp/foo And here, prefix is used as the base location, and the command uses the schemes defined for each platform. So stuff will be installed in /tmp/foo (bin/ , lib/python2.6, etc) == root == With root, you just need to provide a path: python setup.py install --root=/tmp/foo In this case, sys.prefix will be used relatively to root (location = root+sys.prefix), so for example, under Mac OS X, I have '/Library/Frameworks/Python.framework/Versions/2.6' for sys.prefix. So stuff will be installed under /tmp/foo/Library/Frameworks/Python.framework/Versions/2.6/ Since both options are used to define the base location, they are mutualy exclusive. That's how it works today. What are you trying to achieve exactly ? Btw: Please don't add Python 2.5 in the versions. Python 2.5 is not a target anymore. |
|
|
msg102732 - (view) |
Author: Tim Kersten (timkersten) |
Date: 2010-04-09 17:06 |
Ok, this is embarrassing. :-/ $ python setup.py install --root=/tmp/ --prefix=/usr running install error: must supply either home or prefix/exec-prefix -- not both The above is not caused by specifying both --root and --prefix as I had assumed. It was my forgetting that I had specified the --home option in a setup.cfg file. I'm so sorry for wasting your time. Having removed the setup.cfg file and have tested it again and now it behaves exactly as I had anticipated. i.e. --prefix is relative to --root, so it is actually possible to specify both. In particular what this allows one to achieve is easiest shown by example: A) $ python setup.py install --prefix=/tmp/test1 B) $ python setup.py install --prefix=/usr/special --root=/tmp/test2 in A) it installs as such: /etc/mypythonapp.settings /tmp/test1/mypythonapp/... in B) it installs as such: /tmp/test2/etc/mypythonapp.settings /tmp/test2/usr/special/mypythonapp/... This bug can be closed. Again, my apologies and thank you for taking the time to help me sort it out. |
|
|
msg102738 - (view) |
Author: Tarek Ziadé (tarek) *  |
Date: 2010-04-09 18:25 |
Ooops you are right, I messed up too in my explanation, I mischecked the code. root and home are mutually exclusive, not root and prefix. In any case, all those options are making it really hard to understand. I'd like to make this story easier in distutils2, So I'll move this issue in there. Maybe we could have a --show-installation-paths option in install that displays the installation paths the install command will use, and from where the options were read from (and in particular from which .cfg files) |
|
|
msg102743 - (view) |
Author: Tim Kersten (timkersten) |
Date: 2010-04-09 19:56 |
Such an option would be useful indeed. An idea, though perhaps it's overkill, would be to show the current values of the options causing problems, specifically if they come from a config file or environment variable. i.e. when setup.cfg contains home=/somewhere $ python setup.py install --prefix=/tmp running install error: must supply either home or prefix/exec-prefix -- not both setup.cfg: home=/somewhere |
|
|
msg110609 - (view) |
Author: Éric Araujo (eric.araujo) *  |
Date: 2010-07-17 22:36 |
Assigning to myself. Not sure if I’ll do the logging idea Tarek suggested or an option to the configure command (#8252). |
|
|