Open YukiRed opened 1 month ago
Package like the following is not install
Turns out it is because launch is not available and unable to pip install launch. Have to change to using subprocess
pip install launch
import subprocess required_packages = { "accelerate": "accelerate", "diffusers": "diffusers", "huggingface_hub": "huggingface-hub", "numpy": "numpy", "cv2": "opencv-python", "PIL": "Pillow", "segment_anything": "segment-anything", "transformers": "transformers", "ultralytics": "ultralytics", "tqdm": "tqdm", "packaging": "packaging", "loguru": "loguru", "rich": "rich", "pydantic": "pydantic", "timm": "timm", } for package in required_packages: try: __import__(package) print(f"{package} is already installed.") except ImportError: try: subprocess.run(["pip", "install", required_packages[package]], check=True) print(f"Successfully installed {required_packages[package]}.") except subprocess.CalledProcessError: print(f"Can't install {required_packages[package]}. Please follow the readme to install manually.")
Although I couldn't reproduce the issue, I have modified the install.py file to allow installation even when the launch package is not found. Please update and try again.
Package like the following is not install
Turns out it is because launch is not available and unable to
pip install launch
. Have to change to using subprocess