Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Deb's of python packages have different prefix for binaries and libraries on Ubuntu #480
Work around: This can be changed by setting the --python-install-bin flag.
Fundamentally, no one will ever agree on one place to have the default location. If I change the default to /usr/local, someone will find it distasteful.
I'm open to discussion, but given I heavily favor backwards compatibility in fpm, it'll be a hard sell to change the current default path. That energy is probably best directed at setting the
Yes, using --python-install-bin works well but it would be nice if binaries and libraries used the same prefix by default. Funny thing though is that on my system "python -c 'from distutils.sysconfig import get_python_lib; print get_python_lib()'" returns "/usr/lib/python2.7/dist-packages" but in debs built with fpm python modules end up in "/usr/local/lib/python27/dist-packages/". That seems not quite right to me but maybe it's an Ubuntu probem?
I should add that the same happens to RPM's built on the same system (Ubuntu 13.04) but IIRC it does not happen with RPM's built on Amazon Linux. On the other hand, on those RPM's the modules are in "/usr/lib/python2.6/site-packages" while data files are still in "/usr/local".
Regarding 'get_python_lib' being different than the install location of setup.py - I believe this is common behavior.
If you take django, for example:
So it installs by default to /usr/local/lib/python2.7/dist-packages - this is the same behavior FPM uses.
I think the bug, if any, is that maybe the install bin path should respect python's default, which appears to be /usr/local/bin on my system:
If I remove the default value in fpm for python's install bin, it installs to /usr/local/bin
As for the default install location for the lib stuff, this is chosen by python and it's configuration. On ubuntu, I find /usr/lib/python2.7/sysconfig.py describes the install locations "posix_local" in the _INSTALL_SCHEMES dict. Beyond that, I haven't looked.
If you desire a different prefix for installation, fpm tries to provide this with the --prefix flag:
Does this help?
I'm happy to remove the default bin path of /usr/bin and let python choose. I think perhaps it was a bug that fpm had a default value that was different from python's and I can't find any evidence in the commit logs to show that it was intentional.