setup.py puts bzrlib in wrong place

Bug #219489 reported by Jakob
4
Affects Status Importance Assigned to Milestone
Bazaar
Invalid
Low
Unassigned

Bug Description

When installing bzr using the setup.py utility, the bzrlib is put into $PREFIX/lib/python/
This is a bit unfortunate, because python libraries/modules are installed in $PREFIX/lib/pythonx.x/ with x.x for example 2.4 or 2.5 for the version of python. So you are forced to set your PYTHONPATH, whilst bzrlib could just as well be installed directly into the pythonx.x directory
(actually, my way of working is to copy the whole thing manually to that dir)

Revision history for this message
Aaron Bentley (abentley) wrote : Re: [Bug 219489] [NEW] setup.py puts bzrlib in wrong place

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jakob wrote:
> Public bug reported:
>
> When installing bzr using the setup.py utility, the bzrlib is put into $PREFIX/lib/python/
> This is a bit unfortunate, because python libraries/modules are installed in $PREFIX/lib/pythonx.x/ with x.x for example 2.4 or 2.5 for the version of python. So you are forced to set your PYTHONPATH, whilst bzrlib could just as well be installed directly into the pythonx.x directory
> (actually, my way of working is to copy the whole thing manually to that dir)

This sounds like a local configuration issue. Could you please describe:
- - what commandline you are using
- - what platform you are doing this on
- - what version of distutils and setuptools you have
- - what are the contents of site-packages/distutils.cfg

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIClmt0F+nu1YWqI0RAj1sAJ9xlSaZ9QNXqMANnaPRe6yCP6nltACfYwUt
k18ZkJNW9947TvGfEcbQpmg=
=Ongo
-----END PGP SIGNATURE-----

Martin Pool (mbp)
Changed in bzr:
status: New → Incomplete
Revision history for this message
Jakob (jakobsybren) wrote :

This sounds like a local configuration issue. Could you please describe:

There are two different setups that I have tried bzr on, and both had
the same issue. I'm not sure what you mean with 'setuptools'; I guess
you mean the setup-function in distutil.core? I have given the version
of that file:
The first setup:

- - what commandline you are using: bash - python version 2.4.4 (#2, Apr 5 2007, 20:11:18)
- - what platform you are doing this on: Debian 4.1.1-21, linux-kernel 2.6.18-6-686 #1/ Gnome desktop 2.14.3
- - what version of distutils and setuptools you have: Distutils 2.4.4 (revision 52269); distutils.core: $Id: core.py 37828 2004-11-10 22:23:15Z loewis $
- - what are the contents of site-packages/distutils.cfg no such file present

The second setup:
- - what commandline you are using: tcsh - python version 2.4.3 (#1, Mar 14 2007, 18:51:08)
- - what platform you are doing this on: CentOS (Red Hat 4.1.1-52, linux-kernel 2.6.18-53.1.13.el5 #1) / Gnome desktop 2.16.0
- - what version of distutils and setuptools you have: Distutils 2.4.1 (revision 38355); distutils.core: $Id: core.py 37828 2004-11-10 22:23:15Z loewis $
- - what are the contents of site-packages/distutils.cfg no such file present

I hope this helps.....

Revision history for this message
Jakob (jakobsybren) wrote :

I noticed that the bug is still listed as incomplete. What else do I need to add here? Maybe the command I use to install:
python setup.py install --home=$STOWPREFIX/bzr-x.x
where I replace the x's with the version
This problem is still present in bzr 1.6.1rc1

Revision history for this message
Jakob (jakobsybren) wrote :

I can't tell what other information I could possibly give, so as far as I can tell it is not an incomplete bug anymore...

Changed in bzr:
status: Incomplete → New
Revision history for this message
John A Meinel (jameinel) wrote :

What happens if you use:

python setup.py install --prefix=XXXX
rather than
install --home=XXXX
?

On this machine it changes the install layout. I'm not sure if that is sufficient for what you need.

As near as I can tell, neither 'python setup.py install --prefix' or '--home' will set up any custom paths for you (which is unfortunate.) I believe this is just a bug in Python itself. That it cannot install to a custom location *and* configure the search path so that scripts will have the libraries in their default search path.

The only way *I* see around this is to not use python's disutils or setuptools, but to have a completely separate installation mechanism. Which I don't think we'll do.

Does any other program that uses disutils work automatically when installed into a custom location? If so, I'd be happy to inspect their setup.py to figure out how to do the same.

Changed in bzr:
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
John A Meinel (jameinel) wrote :

I *did* find this document for 'setuptools':
http://peak.telecommunity.com/DevCenter/EasyInstall#custom-installation-locations

Basically, it *always* requires some level of additional configuration on the part of the user.

You can do the "Admin Install"
http://peak.telecommunity.com/DevCenter/EasyInstall#administrator-installation

Which requires you to add
import sys; sys.addsitedir('path/to/lib/python')

Which is pretty much the same as setting PYTHONPATH (except it also handles .pth files).

There is also "Virtual Installation":
http://peak.telecommunity.com/DevCenter/EasyInstall#creating-a-virtual-python

Which involves downloading another script. When you run it, it basically copies the python executable into a custom location, so that when it starts up, it uses a different default search path (which is customized to each install directory.)

So I'm tending to mark this as either a bug in upstream, or just WontFix for now, as it is just a limitation of setup tools (disutils/setuptools) and I don't think we are going to be reimplementing them.

Revision history for this message
Jakob (jakobsybren) wrote :

Actually, using the --prefix option instead of the --home option solves the issue. From the help of setuptools I got this:

Options for 'install' command:
  --prefix installation prefix
  --home (Unix only) home directory to install under

So apparently indeed there is a subtle difference, even though I don't see what it is. But that's something for the setuptools-people to answer. My personal feeling though is that the installation instructions in the 'INSTALL' file that comes with bzr, should be changed and it should say to use --prefix instead of --home?

Changed in bzr:
status: Incomplete → Fix Released
Revision history for this message
Dan Watkins (oddbloke) wrote :

I think that if we're telling people how to install in their home directory, then using the well-known 'install in home directory' option for the standard Python build system is probably wise.

But this isn't really relevant to this bug. If you feel strongly about it, please feel free to open another bug. :)

Changed in bzr:
status: Fix Released → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.