Skip to content

Installer can create a pip-less venv; venv prerequisites not documented in install paths #28

@pliablepixels

Description

@pliablepixels

Summary

On distros that ship the bundled pip wheel separately from the venv module (Debian/Ubuntu, where it lives in the python3-venv package), install.sh can create the shared venv at /opt/zoneminder/venv without bootstrapping pip. The result is a venv whose bin/ contains python, python3, python3.12 but no pip.

The user then hits Path 1 Step 2, which says to run:

/opt/zoneminder/venv/bin/pip install opencv-contrib-python

…and gets "no such file or directory" with no clear indication of why.

Root cause

  1. install.sh guards venv creation with python3 -m venv --help (ensure_venv()). --help succeeds even when ensurepip has no bundled pip wheel, so the guard passes and python3 -m venv produces a pip-less venv without erroring loudly.
  2. The pip3/python3-venv prerequisite was only mentioned on the docs overview page (installation.rst), not in the Path 1 or Path 2 install steps where it matters.

Expected

  • The installer should detect a pip-less venv and bootstrap pip (via ensurepip, installing the distro bootstrap package if needed), or fail with an actionable error.
  • Both install paths should state the pip3 / python3-venv prerequisite up front.

Fix

  • install.sh: add ensure_venv_pip() that runs after the venv is created and verifies bin/pip exists; if not, runs python -m ensurepip --upgrade (installing python3-venv/python3-pip first when the wheel is missing), and errors out with distro-specific instructions if it still can't.
  • Docs: add a Prerequisites callout to both install_path1.rst and install_path2.rst covering python3-pip/python3-venv, including the recovery command for an already-created pip-less venv.

Reported via a user who found bin/ had only python* and no pip.

— Claude

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentation

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions