Importing python modules installed by portmod in packages isn't working properly
This should have been possible since portmod 2.4, but for some reason, it only works if I override PYTHONPATH with any non-empty value in the main process (noting that it gets set in the profile regardless).
That is, for a package which tries to import something like configtool, merging the package is possible only if I prefix the command with PYTHONPATH=/
(or similar).
I see no significant differences between the values of sys.path
(within the sandbox).
- With override:
['/home/benjamin/workspace/portmod', '', '/home/benjamin/.local/share/portmod/openmw/lib/python', '/home/benjamin/workspace/portmod', '/home/benjamin/workspace/portmod/bin', '/', '/usr/lib/python310.zip', '/usr/lib/python3.10', '/usr/lib/python3.10/lib-dynload', '/usr/lib/python3.10/site-packages']
- without override:
['/home/benjamin/workspace/portmod', '', '/home/benjamin/.local/share/portmod/openmw/lib/python', '/home/benjamin/workspace/portmod', '/home/benjamin/workspace/portmod/bin', '/usr/lib/python310.zip', '/usr/lib/python3.10', '/usr/lib/python3.10/lib-dynload', '/usr/lib/python3.10/site-packages']
That said, I'm not actually sure why the working directory is ending up in (It's the sys.path
(only occurring within the sandbox, the first three being prepended during sandbox setup, the first by the wrapper code and the last by the profile's PYTHONPATH).bin/portmod
wrapper file)
This is blocking openmw-mods!363 (merged).