Skip to content

Commit 708539c

Browse files
aivrarclaude
andcommitted
Fix venv creation failing with embedded Python
Embedded Python 3.10 does not include the venv module, so `python -m venv` always fails. Switch to virtualenv (pip-installed) which works with embedded Python. Also fix operator precedence bug in run_git_clone that could trigger editable installs when disabled. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b0410de commit 708539c

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

install_configs/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ def run_git_clone(
178178
return False, "\n".join(output_lines)
179179

180180
# Run editable install if requested
181-
if editable and os.path.exists(os.path.join(clone_path, "setup.py")) or \
182-
os.path.exists(os.path.join(clone_path, "pyproject.toml")):
181+
if editable and (os.path.exists(os.path.join(clone_path, "setup.py")) or
182+
os.path.exists(os.path.join(clone_path, "pyproject.toml"))):
183183
if log_callback:
184184
log_callback(f"Installing {repo_name} in editable mode...")
185185

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# (TTS model dependencies are installed in separate venvs)
44

55
# --- GUI & Utilities ---
6+
virtualenv>=20.25.0
67
huggingface_hub>=0.20.0
78
requests>=2.28.0
89
tqdm>=4.64.0

tts_manager.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1635,8 +1635,10 @@ def _run_env_install(self, env: TTSEnvironment):
16351635

16361636
if not env.venv_path.exists():
16371637
self.log(f"Creating virtual environment at {env.venv_path}...")
1638+
# Use virtualenv (pip-installed) instead of venv (stdlib) because
1639+
# embedded Python does not include the venv module.
16381640
result = subprocess.run(
1639-
[PYTHON_PATH, "-m", "venv", str(env.venv_path)],
1641+
[str(PYTHON_PATH), "-m", "virtualenv", str(env.venv_path)],
16401642
capture_output=True, text=True
16411643
)
16421644
if result.returncode != 0:

0 commit comments

Comments
 (0)