Skip to content

[needs fixing] Fix python site-packages dir#3916

Open
NTULINUX wants to merge 1 commit intoLinuxCNC:masterfrom
NTULINUX:fix-site-packages
Open

[needs fixing] Fix python site-packages dir#3916
NTULINUX wants to merge 1 commit intoLinuxCNC:masterfrom
NTULINUX:fix-site-packages

Conversation

@NTULINUX
Copy link
Copy Markdown
Contributor

@NTULINUX NTULINUX commented Apr 9, 2026

Fixes the need for PYTHONPATH on Gentoo

Fixes the need for PYTHONPATH on Gentoo

Signed-off-by: Alec Ari <neotheuser@ymail.com>
@NTULINUX
Copy link
Copy Markdown
Contributor Author

NTULINUX commented Apr 9, 2026

Looks like this needs to be fixed to account for Debian..

dh_install: error: missing files, aborting

Ah, looks like various parts of the tree are also hard-coded to use /usr/lib/python3/dist-packages

docs/src/plasma/qtplasmac.adoc:/usr/lib/python3/dist-packages/qtvcp/designer/install_script
lib/python/qtvcp/designer/install_script:    if [ -f /usr/lib/python3/dist-packages/qtvcp/plugins/qtvcp_plugin.py ]; then
lib/python/qtvcp/designer/install_script:        pifile=/usr/lib/python3/dist-packages/qtvcp/plugins/qtvcp_plugin.py
lib/python/qtvcp/designer/install_script:        echo -e '\n'"$pifile "'not found in /usr/lib/python3/dist-packages/qtvcp/plugins/'
scripts/setup_designer.in:    if [ -f /usr/lib/python3/dist-packages/qtvcp/plugins/qtvcp_plugin.py ]; then
scripts/setup_designer.in:        pifile=/usr/lib/python3/dist-packages/qtvcp/plugins/qtvcp_plugin.py
scripts/setup_designer.in:        echo -e '\n'"$pifile"' not found in /usr/lib/python3/dist-packages/qtvcp/plugins/'

Did not see these. Any tips? The issue is that depending on the exact version of python that debian uses will affect the installation path, which will vary from each debian release, that's the tricky part to make this work across all versions. Not sure on a clean way to avoid the hard-coded variables either, as those will also change.

@NTULINUX NTULINUX changed the title Fix python site-packages dir [needs fixing] Fix python site-packages dir Apr 9, 2026
@BsAtHome
Copy link
Copy Markdown
Contributor

BsAtHome commented Apr 9, 2026

Is there a distro independent way to find out where python packages need to be installed?

@NTULINUX
Copy link
Copy Markdown
Contributor Author

NTULINUX commented Apr 9, 2026

Well that's what this should do:

https://github.com/LinuxCNC/linuxcnc/blob/master/src/m4/ax_python_devel.m4#L340

That's where I got PYTHON_SITE_PKG from. There's also python -c "import site; print(site.getsitepackages())"

That's going to change though distro to distro... The commands themselves are universal, the result is not.

PYTHON_SITE_PKG works but debian/linuxcnc.install.in needs to account for it. It is hard-coded to usr/lib/python3 as well as other parts of the tree.

git grep -e "usr/lib/python3"

Using PYTHON_SITE_PKG works for both a system-wide install though, and run-in-place.

I just checked in my Trixie VM and PYTHON_SITE_PKG is working as intended (both rip and system-wide install.)

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

Successfully merging this pull request may close these issues.

2 participants