fix: remove --system-site-packages to avoid Python 3.12+ conflicts (#79)

Fixes #66

The --system-site-packages flag causes the virtual environment to inherit
system packages, which can include versions incompatible with newer Python
versions. On Arch/EndeavourOS with Python 3.12, an old coverage package
from the system causes Whisper to fail with:

    module 'coverage.types' has no attribute 'Tracer'

By creating an isolated virtual environment, all dependencies are installed
at compatible versions within the venv, avoiding such conflicts.
This commit is contained in:
Jatin K Malik
2026-01-28 19:54:11 -08:00
committed by GitHub
parent 9bae706bbd
commit 8a84b2c97f
+5 -7
View File
@@ -568,13 +568,11 @@ setup_virtual_environment() {
fi
# Create virtual environment
python3 -m venv "$VENV_DIR" --system-site-packages || {
print_error "Failed to create virtual environment"
print_info "Trying without --system-site-packages..."
python3 -m venv "$VENV_DIR" || {
print_error "Failed to create virtual environment. Please check your Python installation."
exit 1
}
# Note: We don't use --system-site-packages to avoid conflicts with system packages
# that may be incompatible with Python 3.12+ (e.g., old coverage versions)
python3 -m venv "$VENV_DIR" || {
print_error "Failed to create virtual environment. Please check your Python installation."
exit 1
}
# Activate virtual environment