[Python Home] [PEP Index] [PEP Source] |
PEP: | XXX |
---|---|
Title: | Alternate location for System-Wide Installation on Linux |
Version: | $Revision$ |
Last-Modified: | $Date$ |
Author: | XXX |
Status: | Draft |
Type: | Standards Track |
Content-Type: | text/x-rst |
Created: | 15-Jul-2016 |
Python-Version: | 3.6 |
Post-History: |
Contents
XXX
This might not end up as a PEP, since it's for pip, but it's still useful to point to a formal-ish document.
XXX
Write this last :)
XXX
The perils of sudo pip; need to install into /local
XXX
Debian's solution: downstream patch of distutils http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/python2.7/trusty/view/head:/debian/patches/distutils-install-layout.diff#L281
XXX
Where to install? What does the FHS say?
Priority of /usr/lib vs. new location?
What happens in virtualenvs?
Making an isolated "System Python" ignore pip-installed packages?
previous discussion: https://groups.google.com/forum/#!topic/pypa-dev/r6qsAmJl9t0
FHS: The /usr/local hierarchy is for use by the system administrator when installing software locally. It needs to be safe from being overwritten when the system software is updated.
If we consider pip as a tool for system administrators, we don't violate FHS using /usr/local/lib/pythonX.Y/site_packages as default install path.
The reason why Debian uses /dist_packages: "The problem was this: if a sysadmin installed a from-source version of Python, say to do development or support some particular application environment, they would then install whatever libraries that application needed into /usr/local/lib/pythonX.Y/site-packages. If /usr/local/.../site-packages was on the system Python's sys.path, then the act of building up your development environment could break system Python."
Result of long discussion on pypa devel 2 years ago, similar to Debian's solution, more flexible (local_prefix).
Proposed by Donald Stufft on distutils-sig. Mixed installation path, mechanism to prevent collisions. Pip can determine that package is already installed by system, dnf and distutils cannot.
- PEP 376 ignored by distutils
- Necessary to switch to .dist-info metadata directory (setup.py install)
- Implement logic to dnf, distutils to check if package isn't already installed
- INSTALLER file could help to resolve updating and removing of packages
sudo pip, python setup.py install will use python. Install locations from Solution2 will be used.
Problem with scripts that only require usr/bin/python3
XXX
should not be a problem, but check Debian
XXX
link to patch/PR
XXX
Add references here
This document has been placed in the public domain.