You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow overriding sys.platlibdir: add PYTHONPLATLIBDIR env var #85031
With the newly added platlibdir [1], if python was configured with platlibdir=lib64, this will break because i.e. the site-packages dir as returned by sysconfig.get_paths() will use lib64 and not lib as the other install may be using.
This PR adds the possibility to override the platlibdir via environment variable.
Fedora and OpenSUSE Linux distributions were using a downstream patch which replaced /lib/ with /lib64/ for like 15 years.
Is this issue a new issue? Or did Fedora always had the issue for example?
Which Linux distribution are you using?
manisandro commented on Jun 6, 2020
manisandromannequin
MannequinAuthor
More actions
I'm on Fedora. My use case is for the mingw-python package I maintain there, see [1] for the full details. I believe (though I haven't investigated) that the previous downstream lib64 patch behaved slightly differently, or that something else between python-3.8 and earlier and python-3.9 changed, in that I didn't have lib64 appear in the site packages path previously when invoking python as detailed in [1], whereas it now does.
bpo-1294959 added sys.platlibdir and configure --with-platlibdir to use /usr/lib64 on Fedora and SuSE to Python 3.9.
The problem is that msg370655 use case seems to be a regression compared to Python 3.9. I now consider to backport the commit 8f023a2 to 3.9 since it looks like a fix part of bpo-1294959 rather than a bug fix.
I created PR 20725 to backport PyConfig.platlibdir and PYTHONPLATLIBDIR env var to Python 3.9.
New changeset 8175064 by Victor Stinner in branch '3.9': bpo-40854: Allow overriding sys.platlibdir via PYTHONPLATLIBDIR env-var (GH-20605) (GH-20725) 8175064
Activity
manisandro commentedon Jun 3, 2020
You can currently point the python interpreter to a different install say via
With the newly added platlibdir [1], if python was configured with platlibdir=lib64, this will break because i.e. the site-packages dir as returned by
sysconfig.get_paths()will use lib64 and not lib as the other install may be using.This PR adds the possibility to override the platlibdir via environment variable.
Full rationale: [2].
[1] #8068
[2] https://src.fedoraproject.org/rpms/python3.9/pull-request/10
vstinner commentedon Jun 5, 2020
Fedora and OpenSUSE Linux distributions were using a downstream patch which replaced /lib/ with /lib64/ for like 15 years.
Is this issue a new issue? Or did Fedora always had the issue for example?
Which Linux distribution are you using?
manisandro commentedon Jun 6, 2020
I'm on Fedora. My use case is for the mingw-python package I maintain there, see [1] for the full details. I believe (though I haven't investigated) that the previous downstream lib64 patch behaved slightly differently, or that something else between python-3.8 and earlier and python-3.9 changed, in that I didn't have lib64 appear in the site packages path previously when invoking python as detailed in [1], whereas it now does.
[1] https://src.fedoraproject.org/rpms/python3.9/pull-request/10#comment-0
vstinner commentedon Jun 8, 2020
New changeset 8f023a2 by Sandro Mani in branch 'master':
bpo-40854: Allow overriding sys.platlibdir via PYTHONPLATLIBDIR env-var (GH-20605)
8f023a2
vstinner commentedon Jun 8, 2020
I merged the patch in master, future Python 3.10. I would prefer to leave Python 3.9 unchanged, if possible. Can we close this issue?
manisandro commentedon Jun 8, 2020
Many thanks! - I'll ask downstream to carry the patch for the 3.9 cycle, so I'm ok with closing.
vstinner commentedon Jun 8, 2020
bpo-1294959 added sys.platlibdir and configure --with-platlibdir to use /usr/lib64 on Fedora and SuSE to Python 3.9.
The problem is that msg370655 use case seems to be a regression compared to Python 3.9. I now consider to backport the commit 8f023a2 to 3.9 since it looks like a fix part of bpo-1294959 rather than a bug fix.
I created PR 20725 to backport PyConfig.platlibdir and PYTHONPLATLIBDIR env var to Python 3.9.
[-][Patch] Allow overriding sys.platlibdir[/-][+][Patch] Allow overriding sys.platlibdir: add PYTHONPLATLIBDIR env var[/+][-][Patch] Allow overriding sys.platlibdir: add PYTHONPLATLIBDIR env var[/-][+]Allow overriding sys.platlibdir: add PYTHONPLATLIBDIR env var[/+]vstinner commentedon Jun 8, 2020
New changeset 8175064 by Victor Stinner in branch '3.9':
bpo-40854: Allow overriding sys.platlibdir via PYTHONPLATLIBDIR env-var (GH-20605) (GH-20725)
8175064
vstinner commentedon Jun 8, 2020
New changeset 5edb832 by Victor Stinner in branch 'master':
bpo-40854: PYTHONPLATLIBDIR env var added to 3.9 (GH-20735)
5edb832
vstinner commentedon Jun 9, 2020
Thanks Sandro Mani. The new env var should be part of the incoming Python 3.9.0 beta3.
vstinner commentedon Jun 11, 2020
Follow-up: bpo-40947 "Replace PLATLIBDIR macro with config->platlibdir".
vstinner commentedon Jun 11, 2020
New changeset d72b964 by Victor Stinner in branch 'master':
bpo-40947: getpath.c uses PyConfig.platlibdir (GH-20807)
d72b964
vstinner commentedon Jun 11, 2020
New changeset dc40105 by Victor Stinner in branch '3.9':
bpo-40947: getpath.c uses PyConfig.platlibdir (GH-20807) (GH-20813)
dc40105