-
Notifications
You must be signed in to change notification settings - Fork 29k
Description
Checklist
- The issue exists after disabling all extensions
- The issue exists on a clean installation of webui
- The issue is caused by an extension, but I believe it is caused by a bug in the webui
- The issue exists in the current version of the webui
- The issue has not been reported before recently
- The issue has been reported before but has not been fixed yet
What happened?
The webui.sh script fails to activate the Python virtual environment, reporting "ERROR: Cannot activate python venv, aborting...". This often occurs after an initial failure due to a missing dependency like python3.10-venv. Even after installing the dependency, subsequent attempts fail.
This happens because an initial run, without the necessary python3.10-venv or if interrupted, can create an incomplete or corrupted venv directory. The webui.sh script's logic checks for an existing venv directory. If it finds one, it doesn't attempt to recreate it, assuming it's valid. However, if this existing venv is corrupted (e.g., missing the activate script), the script then fails to find the activate script, leading to the "Cannot activate python venv, aborting..." error. This creates a persistent loop where the script never fixes the broken environment.
Resolution:
Manually remove the corrupted venv directory. This forces webui.sh to treat it as a fresh run and recreate the virtual environment correctly.
Steps to resolve:
- Ensure all necessary system dependencies (e.g., python3.10-venv) are installed.
- Navigate to the root directory of the stable-diffusion-webui project.
- Remove the existing virtual environment directory:
1 rm -rf venv
- Run the webui.sh script again. It should now successfully create and activate the virtual environment.
Steps to reproduce the problem
./webui.sh
What should have happened?
It should check if you have the ability to install a venv before creating the directory, install the dependency rather than failing, and remove a corrupted one if it fails to activate.
What browsers do you use to access the UI ?
Google Chrome
Sysinfo
Console logs
$ ./webui.sh
################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye), Fedora 34+ and openSUSE Leap 15.4 or newer.
################################################################
################################################################
Running on <redacted> user
################################################################
################################################################
Repo already cloned, using it as install directory
################################################################
################################################################
ERROR: Cannot activate python venv, aborting...
################################################################
$
Additional information
This is first run without Python 3.10-venv installed. After installing, it still doesn't work because of the now broken, existing, venv. The script tells you to install the dependency, but doesn't clean up the failed creation, and then fails to start, because the venv is broken.