setup.py install --prefix=/usr/local installs modules in site-packages/ directory

Bug #365352 reported by Krzysztof Klimonda
10
Affects Status Importance Assigned to Milestone
python2.6 (Ubuntu)
Triaged
Low
Unassigned

Bug Description

Binary package hint: python2.6

When ``--prefix=/usr/local'' is passed to ``python setup.py install'' modules are installed in /usr/local/python2.6/site-packages/ which isn't in the sys.path. It obviously breaks imports.
It may have happened when this bug was fixed: https://bugs.launchpad.net/ubuntu/+source/python2.6/+bug/338395

ProblemType: Bug
Architecture: amd64
DistroRelease: Ubuntu 9.04
NonfreeKernelModules: nvidia
Package: python2.6 2.6.2-0ubuntu1
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: python2.6
Uname: Linux 2.6.28-11-generic x86_64

Tags: packaging
Revision history for this message
Krzysztof Klimonda (kklimonda) wrote :
Revision history for this message
Krzysztof Klimonda (kklimonda) wrote :

On the other hand if this result is expected and it was a design decision we should clearly state it somewhere.
Whole migration to dist-packages/ should be documented as well - right now we differ from mainstream python and all the others distribution. Also our own python2.5 package doesn't use dist-packages/ but site-packages/ as expected. It's really confusing and it will catch many users off guard..

Revision history for this message
Peter Antoniac (pan1nx) wrote :

I agree that unless there is something else, this will cause problems...

Changed in python2.6 (Ubuntu):
status: New → Confirmed
tags: added: likely-dup packaging
Revision history for this message
Peter Antoniac (pan1nx) wrote :

I changed the importance to Low, as this bug that has a moderate impact on non-core applications...

Changed in python2.6 (Ubuntu):
importance: Undecided → Low
status: Confirmed → Triaged
tags: removed: likely-dup
Revision history for this message
ilmarw (ilmar-wilbers) wrote :

I can confirm this bug. Although not critical, it is really annoying.

Revision history for this message
Matthias Klose (doko) wrote :

The behaviour is intended. How to work around this:

 - Don't specifiy --prefix=/usr/local, as it's the default for setup.py install anyway.

 - Add --install-layout=deb together with --prefix=/usr/local

Revision history for this message
ilmarw (ilmar-wilbers) wrote :

OK, read the thread https://lists.ubuntu.com/archives/ubuntu-devel/2009-February/027439.html

I guess that would make things more understandable for other users suspecting a bug and finding this bug report.

Revision history for this message
Max Bowsher (maxb) wrote :

Matthias, are you sure this behaviour is intentional, and if so, by what rationale? It seems plain wrong.

For that matter, why is --install-layout=deb not the default when using a deb-packaged python executable?

Revision history for this message
Brodie Rao (brodie) wrote :

This breaks installation of applications like Mercurial that supply --prefix=/usr/local when installing. This has worked with previous versions of Debian and Ubuntu, and it works with most other distributions I'm aware of. It does this specifically not to interfere with distribution-provided packages.

Given that installing other binaries, resources, etc. to their /usr/local equivalents isn't an issue, I don't see why it should be for Python, using the canonical method of doing so with distutils.

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.