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
In Ubuntu 22.04 the pythondir gets identified as ${exec_prefix}/local/lib/python3.10/dist-packages. But because ${exec_prefix} defaults to /usr/local this makes the pythondir be under /usr/local/local/... (with an extra local). With non-default prefixes, the extra local is likely to also be undesired.
This appears to be due to a debian patch to use the "posix_local" scheme as the default in sysconfig. So the issue will impact all debian-derives distros that inherit this behaviour. A debian mailing list post on the topic suggests that build tools can use the "posix_prefix" scheme instead. But when I change m4/python.m4 to try that, then pythondir becomes ${exec_prefix}/lib/python3.10/site-packages, which solves the extra local, but now uses the site-packages subdirectory instead of the desired dist-packages on debian-derived systems.
I'm not sure how best to fix this. It's possible to detect the "posix_local" scheme and then specifically hack out the extra local. But that feels fragile and like asking for future trouble. One could argue this is a debian bug, but I don't think doing so helps make the problem go away.
My workaround is to configure with --with-python-module-dir=/usr/local/lib/python3.10/dist-packages
(This discussion all applies after the fix in pull request #7 has been merged, to fix python version detection with more than 3 digits.)
The text was updated successfully, but these errors were encountered:
sbenton
changed the title
Incorrect default python install path in
Incorrect default python install path in Ubuntu 22.04
Oct 16, 2022
In Ubuntu 22.04 the
pythondir
gets identified as${exec_prefix}/local/lib/python3.10/dist-packages
. But because${exec_prefix}
defaults to/usr/local
this makes thepythondir
be under/usr/local/local/...
(with an extralocal
). With non-default prefixes, the extralocal
is likely to also be undesired.This appears to be due to a debian patch to use the
"posix_local"
scheme as the default insysconfig
. So the issue will impact all debian-derives distros that inherit this behaviour. A debian mailing list post on the topic suggests that build tools can use the"posix_prefix"
scheme instead. But when I changem4/python.m4
to try that, thenpythondir
becomes${exec_prefix}/lib/python3.10/site-packages
, which solves the extralocal
, but now uses thesite-packages
subdirectory instead of the desireddist-packages
on debian-derived systems.I'm not sure how best to fix this. It's possible to detect the
"posix_local"
scheme and then specifically hack out the extralocal
. But that feels fragile and like asking for future trouble. One could argue this is a debian bug, but I don't think doing so helps make the problem go away.My workaround is to
configure
with--with-python-module-dir=/usr/local/lib/python3.10/dist-packages
(This discussion all applies after the fix in pull request #7 has been merged, to fix python version detection with more than 3 digits.)
The text was updated successfully, but these errors were encountered: