Summary
Community‑maintained extensions for Sioyek (e.g. the official add_text.py, translate.py, etc.) assume they will be executed with the system Python 3.10/3.11.
The Flatpak build, however, bundles Python 3.12 inside the sandbox and does not expose the host interpreter. This mismatch means:
-
python3 -m sioyek.add_text … inside the Flatpak fails with
ModuleNotFoundError: No module named 'sioyek'
because the extension was installed under ~/.local/lib/python3.10/site‑packages, not python3.12/site‑packages.
-
Attempting to pip install sioyek for 3.12 inside the sandbox is impossible:
- Flatpak is immutable (no
pip / no build tools).
- Even if I expose my host
site‑packages, byte‑compiled .so wheels built for 3.10 won’t load under 3.12.
-
Work‑arounds tried:
- Expose host site‑packages → version mismatch (3.10 vs 3.12).
- Wrap host python in
~/bin/python3-host + flatpak override --filesystem=~/bin:ro → spawning from outside the sandbox is counterproductive.
flatpak-spawn --host same as above.
Running outside the sandbox doesn't seem to work because the extensions for some reason need access to the path of the instance that is running, "%{sioyek_path}".
Steps to reproduce
-
Install Sioyek via Flatpak on Pop !_OS 22.04.
-
Clone the official extensions repo
git clone https://github.com/ahrm/sioyek-python-extensions.git ~/.sioyek-extensions
-
Add in prefs_user.config:
new_command _add_text python -m sioyek.add_text "%{sioyek_path}" "%{local_database}" "%{shared_database}" "%{file_path}" "%{selected_rect}" "%{command_text}"
-
pip3.10 install --user --upgrade ~/.sioyek-extensions
-
Add this env var to the flatpak and allow the sandbox to read from it PYTHONPATH=/home/user/.local/lib/python3.10/site-packages
-
Restart Sioyek, invoke _add_text.
Actual result
/usr/bin/python3: Error while finding module specification for 'sioyek.add_text'
(ModuleNotFoundError: No module named 'sioyek')
Root causeIt doesn't find the module even tho it is in the PYTHONPATH because it is checking python3.12/site-packages
Why this matters
- All official/community extensions depend on being able to import the
sioyek Python package.
- Users cannot feasibly rebuild wheels for Python 3.12 inside the immutable sandbox.
Possible solutions
- Bundle Python 3.10/3.11 (same minor version the upstream dev used) inside the Flatpak, or
- Ship the extensions as part of the Flatpak and ensure they import against the bundled runtime.
Environment
- OS: Pop !_OS 22.04 (Ubuntu 22.04 base)
- Host Python: 3.10/12
- Flatpak Sioyek runtime Python: 3.12.0
- Sioyek Flatpak version: 2.0.0.fl1
- Extensions repo commit: ee86154
Thanks in advance for your time and attention.
Summary
Community‑maintained extensions for Sioyek (e.g. the official
add_text.py,translate.py, etc.) assume they will be executed with the system Python 3.10/3.11.The Flatpak build, however, bundles Python 3.12 inside the sandbox and does not expose the host interpreter. This mismatch means:
python3 -m sioyek.add_text …inside the Flatpak fails withbecause the extension was installed under
~/.local/lib/python3.10/site‑packages, notpython3.12/site‑packages.Attempting to
pip install sioyekfor 3.12 inside the sandbox is impossible:pip/ no build tools).site‑packages, byte‑compiled.sowheels built for 3.10 won’t load under 3.12.Work‑arounds tried:
~/bin/python3-host+flatpak override --filesystem=~/bin:ro→ spawning from outside the sandbox is counterproductive.flatpak-spawn --hostsame as above.Running outside the sandbox doesn't seem to work because the extensions for some reason need access to the path of the instance that is running,
"%{sioyek_path}".Steps to reproduce
Install Sioyek via Flatpak on Pop !_OS 22.04.
Clone the official extensions repo
git clone https://github.com/ahrm/sioyek-python-extensions.git ~/.sioyek-extensionsAdd in
prefs_user.config:new_command _add_text python -m sioyek.add_text "%{sioyek_path}" "%{local_database}" "%{shared_database}" "%{file_path}" "%{selected_rect}" "%{command_text}"pip3.10 install --user --upgrade ~/.sioyek-extensionsAdd this env var to the flatpak and allow the sandbox to read from it
PYTHONPATH=/home/user/.local/lib/python3.10/site-packagesRestart Sioyek, invoke
_add_text.Actual result
Root causeIt doesn't find the module even tho it is in the PYTHONPATH because it is checking python3.12/site-packages
Why this matters
sioyekPython package.Possible solutions
Environment
Thanks in advance for your time and attention.