-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
79 lines (62 loc) · 2.52 KB
/
setup.py
File metadata and controls
79 lines (62 loc) · 2.52 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/usr/bin/env python3
"""
Setup script for Voice Controller
This script will install all required dependencies for the voice controller
"""
import subprocess
import sys
import os
def install_package(package):
"""Install a package using pip"""
try:
subprocess.check_call([sys.executable, "-m", "pip", "install", package])
return True
except subprocess.CalledProcessError:
return False
def main():
print("🔧 Setting up Voice Controller for Windows...")
print("=" * 50)
# Check if we're on Windows
if os.name != 'nt':
print("⚠️ Warning: This voice controller is designed for Windows.")
print("Some features may not work on other operating systems.")
# Read requirements from file
requirements_file = "requirements.txt"
if not os.path.exists(requirements_file):
print(f"❌ {requirements_file} not found!")
return False
print("📦 Installing required packages...")
with open(requirements_file, 'r') as f:
packages = [line.strip() for line in f if line.strip() and not line.startswith('#')]
failed_packages = []
for package in packages:
print(f"Installing {package}...")
if install_package(package):
print(f"✅ {package} installed successfully")
else:
print(f"❌ Failed to install {package}")
failed_packages.append(package)
print("\n" + "=" * 50)
if not failed_packages:
print("🎉 All packages installed successfully!")
print("\n🎤 You can now run the voice controller with:")
print("python voice_controller.py")
# Special instructions for PyAudio on Windows
print("\n📝 Note: If you have issues with PyAudio on Windows:")
print("1. Download the appropriate .whl file from:")
print(" https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio")
print("2. Install it with: pip install <downloaded_file>.whl")
return True
else:
print(f"❌ Failed to install: {', '.join(failed_packages)}")
print("\n🔧 Try installing manually with:")
for package in failed_packages:
print(f"pip install {package}")
return False
if __name__ == "__main__":
success = main()
if success:
print("\n🚀 Setup complete! Ready to use voice controller.")
else:
print("\n⚠️ Setup completed with some issues. Check the error messages above.")
input("\nPress Enter to exit...")