Skip to content

Extensions cannot run because Flatpak ships Python 3.12 while community extensions target Python 3.10/3.11 #28

Description

@Raian256

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:

    1. Expose host site‑packages → version mismatch (3.10 vs 3.12).
    2. Wrap host python in ~/bin/python3-host + flatpak override --filesystem=~/bin:ro → spawning from outside the sandbox is counterproductive.
    3. 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

  1. Install Sioyek via Flatpak on Pop !_OS 22.04.

  2. Clone the official extensions repo
    git clone https://github.com/ahrm/sioyek-python-extensions.git ~/.sioyek-extensions

  3. 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}"

  4. pip3.10 install --user --upgrade ~/.sioyek-extensions

  5. Add this env var to the flatpak and allow the sandbox to read from it PYTHONPATH=/home/user/.local/lib/python3.10/site-packages

  6. 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

  1. Bundle Python 3.10/3.11 (same minor version the upstream dev used) inside the Flatpak, or
  2. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions