flathub / flathub/com.github.ahrm.sioyek

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

Open
#28 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
3
Forks
3
PR merge metrics
No merged PRs in 30d

Description

### 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 cause**It doesn't find the module even tho it is in the PYTHONPATH because it is checking python3.1**2**/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
3. **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](https://github.com/ahrm/sioyek-python-extensions/commit/ee86154093d73201a4cff952c1c3495576d1638b)

Thanks in advance for your time and attention.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the _add_text command from prefs_user.config with the Flatpak Sioyek 2.0.0.fl1 runtime, then inspect how the bundled Python 3.12 resolves the sioyek.add_text module from the extensions repository. Compare this with the Python 3.10 installation described in the report. Done means the official extensions, including add_text.py and translate.py, import and run inside the sandbox.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.