Repository navigation
Expand file tree
/
Copy pathsetup.py
More file actions
108 lines (91 loc) · 4.56 KB
/
Copy pathsetup.py
File metadata and controls
108 lines (91 loc) · 4.56 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
"""
🤖 Jarvis AI — One-Time Setup & Installation
⚡ Installs the Python dependencies for THIS operating system only: the OS-specific
packages in requirements.txt carry `sys_platform` markers, ensuring macOS or Linux
users never pull Windows-only libraries (and vice-versa). It also automatically
fetches the Playwright browsers required for seamless web automation.
📱 Android & Device Control:
* Includes built-in Phone controlling support, allowing you to
control, automate, and manage mobile devices directly through the assistant!
✨ Two things deliberately excluded from automatic installation:
* 🎙️ The optional local wake word ("Hey Jarvis") — one-click, opt-in, available
via ⚙ → WAKE WORD inside the application settings;
* 👁️ HUD rendering elements — procedural holographic models render in software
using PyQt6 and NumPy. No dedicated GPU, OpenGL, or extra packages required.
"""
import platform
import subprocess
import sys
from pathlib import Path
OS = platform.system()
HERE = Path(__file__).resolve().parent
MIN_PY = (3, 11)
MAX_PY = (3, 13)
def _run(label: str, args: list[str]) -> None:
print(f"\n▶ {label}")
subprocess.run(args, check=True)
def _check_python() -> None:
"""Fail immediately and clearly rather than deep inside a pip resolver.
A wrong interpreter is the single most common way this install goes sideways,
and the error it produces on its own names a wheel, not the real problem.
"""
v = sys.version_info[:2]
if v > MAX_PY:
print(f"\n⚠️ Python {v[0]}.{v[1]} is newer than the "
f"{MAX_PY[0]}.{MAX_PY[1]} this is tested on. Continuing — if a "
f"package has no wheel yet, install Python "
f"{MAX_PY[0]}.{MAX_PY[1]} and run setup with that.")
return
if v < MIN_PY:
print(f"\n❌ Python {v[0]}.{v[1]} detected — ASDcuber521 needs at "
f"least Python {MIN_PY[0]}.{MIN_PY[1]}.")
print(" Install a supported version and run setup with it, e.g.:")
print(f" py -{MIN_PY[0]}.{MIN_PY[1]} setup.py (Windows)")
print(f" python{MIN_PY[0]}.{MIN_PY[1]} setup.py (macOS / Linux)")
sys.exit(1)
def main() -> None:
print(f"⚙ Jarvis — detected OS: {OS or 'unknown'}, "
f"Python {sys.version_info[0]}.{sys.version_info[1]}")
_check_python()
_run("Installing Python dependencies (OS-specific extras auto-filtered)…",
[sys.executable, "-m", "pip", "install", "-r", "requirements.txt"])
try:
_run("Installing Playwright browsers (chromium + firefox)…",
[sys.executable, "-m", "playwright", "install", "chromium", "firefox"])
except (subprocess.CalledProcessError, FileNotFoundError) as e:
print(f"\n⚠️ Playwright browsers were not installed ({e}).")
print(" Everything except browser automation works. Retry later with:")
print(f' {sys.executable} -m playwright install chromium firefox')
if OS == "Windows":
try:
import win32com.client # noqa: F401
except ImportError:
postinstall = Path(sys.executable).parent / "Scripts" / "pywin32_postinstall.py"
print(
"\n⚠️ pywin32 did not register correctly — desktop-shortcut "
"creation will use a slower fallback. To fix it, run:\n"
f' "{sys.executable}" -m pip install --force-reinstall pywin32\n'
f' "{sys.executable}" "{postinstall}" -install'
)
elif OS == "Linux":
print(
"\nℹ️ Linux note — a few voice-controlled OS actions shell out to "
"native tools. Install the ones you'll use via your package manager:\n"
" • volume → pulseaudio-utils (pactl)\n"
" • brightness → brightnessctl\n"
" • reminders → systemd (systemd-run) or 'at'\n"
" • open URLs → xdg-utils (xdg-open)"
)
elif OS == "Darwin":
print(
"\nℹ️ macOS note — volume, brightness and reminders use the built-in "
"'osascript' / LaunchAgents, so no extra tools are required.\n"
" For Safari automation only: python -m playwright install webkit"
)
print("\n✅ Setup complete!")
print(" 1) Launch it: python main.py")
print(" 2) Paste your free Gemini API key when the setup screen appears.")
print(" 3) (Optional) Enable 'Hey Jarvis' from ⚙ → WAKE WORD.")
if __name__ == "__main__":
main()
#by ASDcuber521