-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
32 lines (28 loc) · 933 Bytes
/
setup.py
File metadata and controls
32 lines (28 loc) · 933 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import os
import sys
import subprocess
# Define the target folder for local installations
LIBS_DIR = os.path.join(os.getcwd(), "libs")
if not os.path.exists(LIBS_DIR):
os.makedirs(LIBS_DIR)
# List of required packages
required_packages = [
"spotipy",
"yt-dlp",
"youtube-search-python",
"mutagen",
"flask",
"requests"
]
def install_packages(packages):
for pkg in packages:
try:
__import__(pkg.replace('-', '_'))
print(f"{pkg} is already installed.")
except ImportError:
print(f"Installing {pkg} into {LIBS_DIR} ...")
subprocess.check_call([sys.executable, "-m", "pip", "install", "--target=" + LIBS_DIR, pkg])
install_packages(required_packages)
print("All dependencies installed/updated in the 'libs' folder.")
print("Launching main application...")
subprocess.check_call([sys.executable, "main.py"])