Issues / #3634

#3634 [Engine] ModuleNotFoundError: No module named 'jinja2' when sharing repository folder between dual-boot OS (Windows <-> Linux)

open · @RenZekta · 2 comentarios · En GitHub

Setup & installServer & APIMulti-GPUAMD / HIPModels & quantsWindowsLinux

Descripción

### Describe the bug
When using Strata in a dual-boot setup with the repository directory is accessed by both Windows and Linux, switching the OS breaks the internal Python virtual environment. 

If Strata is initially set up on Windows, it successfully creates the `.venv` directory and installs all dependencies (including `jinja2`). However, when booting into Fedora Linux and executing `./setup.sh` inside the same folder, Strata detects that `.venv` already exists, skips dependency synchronization, compiles the HIP binaries for the AMD GPU successfully, but then crashes with `ModuleNotFoundError: No module named 'jinja2'` because the Windows-generated `.venv` path structures and packages are incompatible/unresolvable by the Linux Python interpreter.

Same happens if Strata was initially set up on Linux and later launched on Windows.

The setup scripts should probably rebuild '.venv' if different OS from previous launch was detected or isolate `.venv` by OS platform (e.g., using `.venv-win` and `.venv-linux`) if they detect a cross-platform repository reuse, or force a pip synchronisation, and store windows and linux engines separately or at least not break them, when the host OS changes

This is not the first time I'm experiencing this issue, it's been like that in older versions too

### Steps to reproduce
1. Boot into Windows, clone the repository to a shared/accessible partition, and run `START-HERE.bat`. Everything works.
2. Boot into Linux (Fedora was used on my machine), navigate to the exact same folder.
3. Run `./setup.sh`.
4. Strata builds the HIP objects for the GPU successfully, writes the start script, but crashes upon launching `serve/server.py` due to a broken virtual environment missing `jinja2`.

Same happens if started in Linux and launched on Windows afterwards.

### Log Output
```text
[2026-10-21T18:31:23.251Z] [stdout] [Coder] /mnt/Alpha/AI/Engines/Strata/Strata/.venv/lib/python3.15/site-packages/_rocm_sdk_core/include/hip/hip_runtime.h
...
[2026-10-21T18:32:27.771Z] [stdout] [Coder]   [ok] start script: run-coder-iq1_m.sh
[2026-10-21T18:32:27.771Z] [stdout] [Coder] All set.
[2026-10-21T18:32:27.773Z] [stdout] [Coder]   [ok] GPU: AMD Radeon RX 9070 series / AI PRO R9700 (gfx1201) (16 GB, AMD)
[2026-10-21T18:32:27.969Z] [stderr] [Coder] Traceback (most recent call last):
[2026-10-21T18:32:27.969Z] [stderr] [Coder]   File "/mnt/Alpha/AI/Engines/Strata/Strata/serve/server.py", line 63, in <module>
[2026-10-21T18:32:27.969Z] [stderr] [Coder]     from serve.frontend import (THINK_END, ChatTemplate, Event, OutputParser, anthropic_to_messages,  # noqa: E402
[2026-10-21T18:32:27.969Z] [stderr] [Coder]   File "/mnt/Alpha/AI/Engines/Strata/Strata/serve/frontend.py", line 28, in <module>
[2026-10-21T18:32:27.969Z] [stderr] [Coder]     import jinja2
[2026-10-21T18:32:27.969Z] [stderr] [Coder] ModuleNotFoundError: No module named 'jinja2'
```



Full log on Linux after setting up on Windows:
[xlm-studio-logs-1792607648225.txt](https://github.com/user-attachments/files/33782657/xlm-studio-logs-1792607648225.txt)


### What if I manually rebuild .venv?
What helped me after booting on Fedora:
```
python3 -m venv --clear .venv
.venv/bin/pip install jinja2 strata pyyaml regex psutil
```
Launches normally


After booting Strata on Windows after this command, I get:
```
[22:00:50] [Qwen 3.8 Flash-Next Coder] Launching "Qwen 3.8 Flash-Next Coder" - engine=Strata - port=1234 (override)
[22:00:50] [Qwen 3.8 Flash-Next Coder] Updating Strata (git) ...
[22:00:51] [Qwen 3.8 Flash-Next Coder] Strata is up to date
[22:00:51] [Qwen 3.8 Flash-Next Coder] No Python at '"/usr/bin\python.exe'
[22:00:51] [Qwen 3.8 Flash-Next Coder] ��� �த������� ������ ���� ������� . . .
[22:00:51] [Qwen 3.8 Flash-Next Coder] ■ Process exited
```

To fix this I did:
```
Remove-Item -Recurse -Force .venv
python -m venv .venv
.venv\Scripts\pip install jinja2 strata pyyaml regex psutil
```
Launches normally


However, when I switch back to Linux and run the `.venv` rebuild script above a second time, I get:
```
...
[22:16:10] [Coder] loading the model (the first start takes a minute or two) ...
[22:16:10] [Coder] [strata] starting the engine: reading the model's weights ...
[22:16:11] [Coder] Traceback (most recent call last):
[22:16:11] [Coder] Warning: Traceback (most recent call last):
[22:16:11] [Coder]   File "/mnt/Alpha/AI/Engines/Strata/Strata/serve/server.py", line 8486, in <module>
[22:16:11] [Coder]     sys.exit(main())
[22:16:11] [Coder]              ~~~~^^
[22:16:11] [Coder]   File "/mnt/Alpha/AI/Engines/Strata/Strata/serve/server.py", line 8194, in main
[22:16:11] [Coder]     engine = StrataEngine(exe, engine_args(cfg) + (effort_end or []), cwd=cfg.get("cwd"), log=cfg.get("log"),
[22:16:11] [Coder]                           env=env, lazy=lazy)
[22:16:11] [Coder]   File "/mnt/Alpha/AI/Engines/Strata/Strata/serve/server.py", line 1101, in __init__
[22:16:11] [Coder]     raise EngineDied(why + (f" (see {log})" if log else "") + note +
[22:16:11] [Coder]                      start_failure_hint(log, log_start) + tail)
[22:16:11] [Coder] EngineDied: the engine exited before it was ready (see /mnt/Alpha/AI/Engines/Strata/Strata/strata-coder-iq1_m.log)
[22:16:11] [Coder] the engine process ended: exit code 127
[22:16:11] [Coder] the engine log's last lines:
[22:16:11] [Coder]   [strata] 2026-10-21 22:16:10 engine started: /mnt/Alpha/AI/Engines/Strata/Strata/engine/strata --serve --pack /mnt/Alpha/AI/Engines/Strata-data/packs/coder-iq1_m --native /mnt/Alpha/AI/Models/lmstudio-community/Qwen3.8-Flash-Next-GSQ-RCO-Coder-GGUF/Qwen3.8-Flash-Next-GSQ-RCO-IQ1_M-00001-of-00002.gguf --ple-gguf /mnt/Alpha/AI/Models/lmstudio-community/Qwen3.8-Flash-Next-GSQ-RCO-Coder-GGUF/Qwen3.8-Flash-Next-GSQ-RCO-IQ1_M-00002-of-00002.gguf --expert-profile /mnt/Alpha/AI/Engines/Strata/Strata/data/expert-profile-coder.bin --expert-cache auto --prefill auto --spec 4 --spec-min-p 0.5 --mtp /mnt/Alpha/AI/Engines/Strata-data/mtp/rt --max-context 32768 --kv int8 --resident-experts --vision
[22:16:11] [Coder]   /mnt/Alpha/AI/Engines/Strata/Strata/engine/strata: error while loading shared libraries: libhipblas.so.3: cannot open shared object file: No such file or directory
[22:16:11] [Coder] Warning: /mnt/Alpha/AI/Engines/Strata/Strata/engine/strata: error while loading shared libraries: libhipblas.so.3: cannot open shared object file: No such file or directory
[22:16:11] [Coder] ■ Process exited
```
So, after both Windows and Linux engine launches, we have a broken engine and `.venv`.


### Environment
- **Strata Version:** latest master branch (Strata 0.2.2/Engine 0.1.47)
- **OS:** Windows 11 & Fedora Linux Dual Boot 
- **Hardware:** AMD Radeon RX 9070 16GB, 32GB RAM

En el sitio

Enlaces a install, modelos, releases.