[Python-Dev] PEP: per user site-packages directory (original) (raw)

glyph at divmod.com glyph at divmod.com
Mon Jan 14 20:13:26 CET 2008


On 06:37 pm, lists at cheimes.de wrote:

glyph at divmod.com wrote:

I think the relevant link to change here would be ~/.local.

I have personally been using the ~/.local convention for a while, and I believe ~/.local/bin is where scripts should go. Python is not the only thing that can be locally installed, and the fact that it's ~/.local/lib/python2.6/site-packages suggests that ~/.local has the same layout as /usr (or /usr/local, for those who use that convention). ~/.local/bin or ~/bin ? ~/bin is the standard directory for user binaries.

"the" standard directory? according to what? commented-out examples in some linux distribution?

I can see how ~/.local/bin follows the idea of other directories.

I think consistency is important here. Python is not the only tool that could follow this convention, and it would be nice to have a consistent convention that it would be easy for other tools and environments to adopt.

But ~/bin is more convenient than ~/.local/bin. I don't want to teach users how to change their .bashrc or .profile file for ~/.local/bin. A line like

as you say, it is often commented out. You have to teach users this anyway, even if sometimes it will work by accident.

~/bin comes from the convention of "./configure --prefix=$HOME", as autoconf suggests. This means users must have visible directories in their home folder named (among other things) "bin", "share", "lib", "src", "sbin", "man", and "include". I find this ugly. I only find it slightly less ugly that Python will now hide its locally-installed library files from me but not its locally-installed executable scripts.

"./configure --prefix=$HOME/.local" will instead put things into ~/.local/bin, ~/.local/lib, etc.

Now, I am aware that setup.py already has a special "--home" option, and it can be incompatibly changed, but I don't see a reason for this. Note that --home $HOME will currently put files into ~/lib, not ~/.local/lib. (and --home $HOME/local will put scripts into ~/.local/bin, not ~/bin).

But, now that I've told you what I think in more detail, unless you like my ideas and have specific questions, I will try to refrain from commenting further, lest I dig my own bike shed here :).



More information about the Python-Dev mailing list