-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Description
What happened?
So many extensions (even popular ones like TemporalKit) are messing up python environments because the wrong way they are checking for dependencies at runtime.
Consider the example code in the wiki (https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Developing-extensions#installpy) for installing an extension, which gets executed at every launch:
import launch
if not launch.is_installed("aitextgen"):
launch.run_pip("install aitextgen==0.6.0", "requirements for MagicPrompt")This breaks for all libraries having a "-" in their name for example ffmpeg-python, scikit-image, etc... which are then installed even when they already are.
As of now the majority of extensions are just iterating over their requirements.txt file with this code... Imagine the inconsistencies this is causing...
Please just add a note to the wiki section about this !
Steps to reproduce the problem
> launch_utils.run_pip("install ffmpeg-python", "required package")
[ Installing required package: "ffmpeg-python" ... ]
[ Installed ]
> launch_utils.is_installed("ffmpeg-python")
False
> launch_utils.is_installed("ffmpeg")
True
What should have happened?
Extension authors reading the wiki should have been reminded to not iterate over requirements.txt using the above code.
Sysinfo
n/a
What browsers do you use to access the UI ?
No response
Console logs
n/aAdditional information
No response