Closed Golgovskiy closed 1 year ago
This is intended behavior. This is done because WebUI checks the script's requirements every boot
You mean, it's just writing it regardless of the result of the check, or does it reinstall requirements every time?
The code is checking if the dependency is installed, and if not, it will install the appropriate version. It will not reinstall the dependency if it is already present.
So... Does it write the message every check or only on install? Or is my system fails check every time for some reason? It works thou.
It just writes the message, even if it is already installed. It won't reinstall it.
I see. Good. Thank you. Any chance to make it not write the message if it doesn't actually installs anything?
I read the script, and I can't understand. It writes message in "if" branch, how come it writes it if it found it installed? There is 5 lines, but I only writes three. That is too say, it didn't find them installed, but pip didn't install because they actually were?
Can you try the new version? I am currently unable to test it myself since I'm at work.
Installing requirements for Web UI
Installing None
Installing onnxruntime-gpu...
Installing None
Installing opencv-python...
Installing None
Installing Pillow...
Installing requirements for Web UI Installing None Installing onnxruntime-gpu... Installing None Installing opencv-python... Installing None Installing Pillow...
I think this may be due to the following reasons:
The is_installed
function in launch.py
uses the importlib.util.find_spec
method, which is used to find the specification of the module, but you use the package name as an argument in install.py
, which should be the module name and not the package name.
So I think the following changes can be made.
if not launch.is_installed("onnx"):
launch.run_pip("install onnx", desc="onnx")
# print("Installing onnx...")
if not launch.is_installed("onnxruntime"): # used to be onnxruntime-gpu
launch.run_pip("install onnxruntime-gpu", desc="onnxruntime-gpu")
# print("Installing onnxruntime-gpu...")
if not launch.is_installed("cv2"): # used to be opencv-python
launch.run_pip("install opencv-python", desc="opencv-python")
# print("Installing opencv-python...")
if not launch.is_installed("numpy"):
launch.run_pip("install numpy", desc="numpy")
# print("Installing numpy...")
if not launch.is_installed("PIL"): # used to be Pillow
launch.run_pip("install Pillow", desc="Pillow")
# print("Installing Pillow...")
Also, I commented out print
and added the argument desc
because print
is already done in the run_pip
method.
I tested it on my computer and it worked as expected. Would you like me to submit a pull request to address this issue?
Happens every single launch. Is this intended behaviour? It does work in UI.