This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: ensurepip not honoring value of $(DESTDIR) - pip not installed
Type: behavior Stage: resolved
Components: Installation Versions: Python 3.6
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: cheryl.sabella, multimiler, yan12125
Priority: normal Keywords:

Created on 2017-11-01 02:08 by multimiler, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg305351 - (view) Author: (multimiler) Date: 2017-11-01 02:08
I am building python from source for installation at /opt/python-3.6.3.  The result of the build will be installed in /somewhere/deb-pkg-build-dir.  I configure, build, and install, the package as follows:

./configure --prefix=/opt/python-$VER --enable-optimizations --with-ensurepip=install
make install DESTDIR=/somewhere/deb-pkg-build-dir

At the very end of the build log I find:

Requirement already satisfied: setuptools in /opt/python-3.6.3/lib/python3.6/site-packages

As a result PIP is not installed.  This is an error.  The pip installation process should be looking in $(DESTDIR)/opt/python-3.6.3.  Instead it is looking at /opt/python-3.6.3/... which is the python installation on the current build host -- NOT INSTALLED BY THIS BUILD.

In the top-level Makefile.pre I find the following that runs ensurepip to install pip:

install:  commoninstall bininstall maninstall
        if test "x$(ENSUREPIP)" != "xno"  ; then \
                case $(ENSUREPIP) in \
                        upgrade) ensurepip="--upgrade" ;; \
                        install|*) ensurepip="" ;; \
                esac; \
                $(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \
                        $$ensurepip --root=$(DESTDIR)/ ; \

As you can see $(DESTDIR) is passed into ensurepip, but it is never used when checking for pip existence.
msg305357 - (view) Author: Chih-Hsuan Yen (yan12125) * Date: 2017-11-01 05:13
This is a pip bug
msg336663 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2019-02-26 13:21
Closing as third-party as @yan12125's report pinpoints the cause of the issue as part of pip.
Date User Action Args
2022-04-11 14:58:53adminsetgithub: 76097
2019-02-26 13:21:49cheryl.sabellasetstatus: open -> closed

nosy: + cheryl.sabella
messages: + msg336663

resolution: third party
stage: resolved
2017-11-01 05:13:18yan12125setnosy: + yan12125
messages: + msg305357
2017-11-01 02:08:45multimilercreate