Python3 modules are not installed in the right path

Bug #1250877 reported by Shu Hung (Koala)
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
automake (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

[Note: this might be a bug in autoconf rather than automake, I'm not entirely sure]

On Ubuntu (and I think also on Debian), Python3 modules are installed in /usr/lib/python3/dist-packages

However, that's different from the upstream path, which is /usr/lib/python3.3/site-packages

Python3 modules building with the Autotools will get installed in the upstream-preferred path, and as a result, Python3 won't find them.

Here is a way to reproduce it:

1. First, install libcangjie from Git:

    git clone git://github.com/Cangjians/libcangjie
    cd libcangjie
    ./autogen.sh --prefix=/usr && make && sudo make install

2. Now, install pycangjie:

    git clone git://github.com/Cangjians/pycangjie
    cd pycangjie
    ./autogen.sh --prefix=/usr && make && sudo make install

(you might need to install some dependencies, like libsqlite3-dev, python3-de and cython)

Now, observe how the module was installed in /usr/lib/python3.3/site-packages/cangjie, where Python3 won't find it.

This installation path is not hardcoded in the pycangjie build process, it is **automatically discovered by the autotools**.

If Ubuntu (or is it Debian?) decides to change where Python3 modules are installed, then shouldn't it also try to ensure that they actually get installed there?

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in automake (Ubuntu):
status: New → Confirmed
Revision history for this message
Shu Hung (Koala) (koalay) wrote :

From *Deviations_from_upstream* in Debina's Python wiki page
https://wiki.debian.org/Python#Deviations_from_upstream

-----------

* dist-packages instead of site-packages. Third party Python software installed from Debian packages goes into dist-packages, not site-packages. This is to reduce conflict between the system Python, and any from-source Python build you might install manually.

-----------

A more detailed discussion on the same issue can be found here in Debian's bug tracker:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=765022#30

That says Debian deliberately treat .deb python packages and manually installed python modules differently. They changed the stock Debian Pythons' module path from `site-packages` to `dist-packages`. So the stock Python uses modules only from DEB sources (installs to `dist-packages`) and not from easy_install or otherwise compiled (installs to `site-packages`).

Automake either doesn't care or horner the management ideal. They only support you to install your python library into `site-packages` so it doesn't overwrite the packages you installed with .deb.

If Automake provide config directive to override `pyexecdir` and `pythondir`, it would be a much better tool for system package developers (e.g. Python based ibus engine developer) for proper testing. I found no such option yet.

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.