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

Closed
opened 2026-11-04 01:51:43 +07:00 by bsakaguchi · 6 comments
Owner

Originally created by @RenZekta on GitHub (Oct 21, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3634

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 and engine.

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

[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

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
Originally created by @RenZekta on GitHub (Oct 21, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/3634 ### 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 and engine. 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
Author
Owner

@github-actions[bot] commented on GitHub (Oct 21, 2026):

Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:

  • Add the Strata version (Settings > About, or strata --version).

Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

Details: CONTRIBUTING.md

<!-- gh-comment-id:6323754508 --> @github-actions[bot] commented on GitHub (Oct 21, 2026): Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing: - [ ] Add the Strata version (Settings > About, or `strata --version`). Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment `/reopen`. Details: [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md)
Author
Owner

@github-actions[bot] commented on GitHub (Oct 21, 2026):

Thanks, this follows the format now.

<!-- gh-comment-id:6323777493 --> @github-actions[bot] commented on GitHub (Oct 21, 2026): Thanks, this follows the format now.
Author
Owner

@Niko1221 commented on GitHub (Oct 29, 2026):

Thank you. Since 0.2.5 setup remembers which system wrote its package list, so a .venv shared by Windows and Linux installs the packages again instead of saying "already installed". The .venv itself is not made portable (Scripts on Windows, bin on Linux): after switching system, delete the .venv folder and run setup once from that system.

Release: https://github.com/Niko1221/Strata/releases/tag/v0.2.5

<!-- gh-comment-id:6491957087 --> @Niko1221 commented on GitHub (Oct 29, 2026): Thank you. Since 0.2.5 setup remembers which system wrote its package list, so a `.venv` shared by Windows and Linux installs the packages again instead of saying "already installed". The `.venv` itself is not made portable (`Scripts` on Windows, `bin` on Linux): after switching system, delete the `.venv` folder and run setup once from that system. Release: https://github.com/Niko1221/Strata/releases/tag/v0.2.5
Author
Owner

@RenZekta commented on GitHub (Oct 30, 2026):

Deleted .venv, updated Strata. Launched on Windows succesfully.
Switched to Linux, Everything rebuilt and launched succesfully.
Switched back to Windows, got an error:

[01:58:22] [Coder] No Python at '"/usr/bin\python.exe'
[01:58:22] [Coder] ��� �த������� ������ ���� ������� . . .
[01:58:22] [Coder] ■ Process exited

Deleted .venv, built and launched on Windows successfully
Switched to Linux for confirmation, rebuilt and launched successfully

Strata: v0.2.8

HOW TO AVOID DELETING .VENV AND REDOWNLOADING THE ENGINE ON OS SWITCH

Run python -m venv .venv to rebuild it on Windows, otherwise errors:

[02:55:10] [Coder] No pyvenv.cfg file
[02:55:10] [Coder] ��� �த������� ������ ���� ������� . . .
[02:55:10] [Coder] ■ Process exited

Launches on Windows successfully

To verify that nothing broke, switched to Linux. The Engine got rebuilt using existing files and launched successfully without additional actions. Afterwards, python -m venv .venv on WIndows and it all launches correctly.

@Niko1221 I propose running python -m venv .venv automatically if the OS Strata was launched from is different from the one that Strata was built for (the one used in pyvenv.cfg) (or at least do it for Windows)

<!-- gh-comment-id:6511513826 --> @RenZekta commented on GitHub (Oct 30, 2026): Deleted .venv, updated Strata. Launched on Windows succesfully. Switched to Linux, Everything rebuilt and launched succesfully. Switched back to Windows, got an error: ``` [01:58:22] [Coder] No Python at '"/usr/bin\python.exe' [01:58:22] [Coder] ��� �த������� ������ ���� ������� . . . [01:58:22] [Coder] ■ Process exited ``` Deleted .venv, built and launched on Windows successfully Switched to Linux for confirmation, rebuilt and launched successfully Strata: v0.2.8 ## HOW TO AVOID DELETING .VENV AND REDOWNLOADING THE ENGINE ON OS SWITCH Run `python -m venv .venv` to rebuild it on Windows, otherwise errors: ``` [02:55:10] [Coder] No pyvenv.cfg file [02:55:10] [Coder] ��� �த������� ������ ���� ������� . . . [02:55:10] [Coder] ■ Process exited ``` Launches on Windows successfully To verify that nothing broke, switched to Linux. The Engine got rebuilt using existing files and launched successfully without additional actions. Afterwards, `python -m venv .venv` on WIndows and it all launches correctly. @Niko1221 I propose running `python -m venv .venv` automatically if the OS Strata was launched from is different from the one that Strata was built for (the one used in pyvenv.cfg) (or at least do it for Windows)
Author
Owner

@Niko1221 commented on GitHub (Oct 31, 2026):

Since 0.2.5 setup installs the package list again after a system switch, and START-HERE.bat and setup.sh both rebuild a .venv made by the other system. The error in your last message (No Python at ... python.exe, No pyvenv.cfg) is from the program that starts Strata, which reads .venv\Scripts\python directly. Which launcher is that? Running python -m venv .venv on Windows is the right step after Linux, as you found; START-HERE.bat does it for you.

<!-- gh-comment-id:6547914174 --> @Niko1221 commented on GitHub (Oct 31, 2026): Since 0.2.5 setup installs the package list again after a system switch, and START-HERE.bat and setup.sh both rebuild a `.venv` made by the other system. The error in your last message (`No Python at ... python.exe`, `No pyvenv.cfg`) is from the program that starts Strata, which reads `.venv\Scripts\python` directly. Which launcher is that? Running `python -m venv .venv` on Windows is the right step after Linux, as you found; START-HERE.bat does it for you.
Author
Owner

@RenZekta commented on GitHub (Oct 31, 2026):

Strata v0.2.9, switching between Windows and Linux works smoothly now, no manual actions needed. Tested by launching and switching between Windows and Linux back and forth 2 times, .venv behaves properly, engine rebuilt correctly, nothing broke. Closing the issue since it's resolved.

<!-- gh-comment-id:6549048107 --> @RenZekta commented on GitHub (Oct 31, 2026): Strata v0.2.9, switching between Windows and Linux works smoothly now, no manual actions needed. Tested by launching and switching between Windows and Linux back and forth 2 times, .venv behaves properly, engine rebuilt correctly, nothing broke. Closing the issue since it's resolved.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#1495
No description provided.