Skip to content

kur.sh stops at the virtualenv step when python3-venv is missing (Colab A100 and L4) #45

Done

Description

@alexturkey

Problem

On Google Colab (A100 and L4, two sessions), ./kur.sh stopped at the Python virtual environment step: ensurepip --upgrade --default-pip returned non-zero exit status 1. This was reported by @behisob in PR #42 [user-reported]; the manual workaround was pip install virtualenv && python3 -m virtualenv <ROOT>/.venv. In our reproduction (below) the failed venv also leaves a half-made .venv folder.

Cause

On Debian/Ubuntu the python3-venv package (which provides ensurepip) is often not installed. We reproduced the same failure on a clean Ubuntu 24.04 container (Python 3.12.3) with python3 and pip present and python3-venv absent [measured, Docker].

Fix

Commits 2d39a56 and 5e5be4c add a fallback in scripts/kur.sh. If python3 -m venv fails, the half-made .venv is removed and the script tries:

  1. as root with apt-get: install python3-venv (a system package, the only step that writes outside the project folder);
  2. otherwise a version- and sha256-pinned virtualenv (scripts/virtualenv-gereksinim.txt), installed only under <ROOT>/.onbellek/virtualenv (two pinned sets: one for Python 3.10, one for 3.11+); the system Python and ~/.local are not touched.

If both fail, it stops with [VT-E-VENV] and a hint (sudo apt-get install python3-venv). When python3-venv is installed, the normal path is unchanged. Documented as item 37 in docs/SIK_HATALAR.md; no change to uret.sh, kur.ps1, the engine or any quality setting.

What we tested [measured, Ubuntu 24.04 (Python 3.12.3) in Docker unless noted, venv step only]

Scenario Result
Package missing (root cause check) venv exit 1, ensurepip is not available, half-made folder left
Root, package missing, apt-get works package installed, venv created, exit 0
Root, package missing, apt-get unavailable pinned virtualenv fallback, exit 0
Non-root user, package missing pinned virtualenv fallback, exit 0
Package installed normal path, no warning, same result as before
Root, apt-get unavailable, Ubuntu 22.04 (Python 3.10.12) pinned virtualenv fallback (3.10 set), exit 0
Offline, package missing clear [VT-E-VENV] error, exit 1, no leftover .venv

The existing Linux script tests also pass (39 tests).

What we did not test

We did not run the full kur.sh (engine build, model download) on a real Colab session; only the virtualenv block was run, in Docker. Python 3.13 was not measured separately; it uses the same 3.11+ set measured on 3.12, so we expect it to behave the same. Colab images change over time, so this fix is based on the reproduced cause, not on a Colab run.

If you hit this on Colab

Please pull the latest main (commit 5e5be4c or newer) and retry ./kur.sh. Reports are welcome, working or not: the Python version, whether you are root, and the lines printed after [VT-E-VENV] help most.

Thanks to @behisob for reporting it.

Activity

  1. alexturkey commented on Dec 2, 2026

    @alexturkey
    OwnerAuthor

    Fixed in 2d39a56 and 5e5be4c on main (CI passed). Closing; if it still happens on Colab, please reopen with the lines printed after [VT-E-VENV].

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