Open
Description
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = None
closed_at = None
created_at = <Date 2017-07-26.16:39:28.627>
labels = ['type-bug', '3.9', 'build']
title = 'ensurepip does not honour the value of $(prefix)'
updated_at = <Date 2020-03-19.10:08:27.658>
user = 'https://github.com/xdegaye'
bugs.python.org fields:
activity = <Date 2020-03-19.10:08:27.658>
actor = 'mcepl'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Cross-Build']
creation = <Date 2017-07-26.16:39:28.627>
creator = 'xdegaye'
dependencies = []
files = ['47041']
hgrepos = []
issue_num = 31046
keywords = ['patch']
message_count = 3.0
messages = ['299252', '299290', '330805']
nosy_count = 6.0
nosy_names = ['ncoghlan', 'mcepl', 'martin.panter', 'dstufft', 'Alex.Willmer', 'ZackerySpytz']
pr_nums = ['17634', '19068']
priority = 'normal'
resolution = None
stage = 'patch review'
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue31046'
versions = ['Python 3.9']
Activity
xdegaye commentedon Jul 26, 2017
When cross-compiling, the local Python interpreter that is used to run ensurepip may not have the same value of sys.prefix as the value of the 'prefix' variable that is set in the Makefile.
With the following values used to install Python locally for a later copy to the files hierarchy owned by the 'termux' application on an Android device:
'make install' causes ensurepip to install pip in
$(DESTDIR)/usr/local
instead of the expected$(DESTDIR)/$(prefix)
where is installed the standard library.The attached patch fixes the problem. The patch was implemented assuming that pip uses distutils for the installation (note that setup.py also uses the --prefix option in the Makefile), but I know nothing about pip so forgive me if the patch is wrong and please just assume it is just a way to demonstrate the problem.
ncoghlan commentedon Jul 27, 2017
This looks like the right technical fix to me (see https://pip.pypa.io/en/stable/reference/pip_install/#cmdoption-prefix), but I'd like Donald to confirm that before we merge anything.
Making this change will also require an update to the ensurepip docs: https://docs.python.org/3/library/ensurepip.html#command-line-interface
mcepl commentedon Nov 30, 2018
Per https://devguide.python.org/pullrequest/, can I ask you Xavier to prepare a proper pull request for this patch to the GitHub repo, please?
pythongh-75229: Add support for setting prefix in ensurepip
bpo-31046: ensurepip does not honour the value of $(prefix)
bpo-31046: ensurepip does not honour the value of $(prefix)