Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect default python install path in Ubuntu 22.04 #8

Open
sbenton opened this issue Oct 16, 2022 · 0 comments
Open

Incorrect default python install path in Ubuntu 22.04 #8

sbenton opened this issue Oct 16, 2022 · 0 comments

Comments

@sbenton
Copy link

sbenton commented 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 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.)

@sbenton sbenton changed the title Incorrect default python install path in Incorrect default python install path in Ubuntu 22.04 Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant