-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_standalone.py
More file actions
84 lines (70 loc) · 2.64 KB
/
Copy pathbuild_standalone.py
File metadata and controls
84 lines (70 loc) · 2.64 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
#!/usr/bin/env python3
"""
Build standalone Neuro executable
No Python installation required to run!
"""
import subprocess
import sys
import os
from pathlib import Path
def check_pyinstaller():
"""Check if PyInstaller is installed"""
try:
import PyInstaller
return True
except ImportError:
return False
def install_pyinstaller():
"""Install PyInstaller"""
print("Installing PyInstaller...")
subprocess.check_call([sys.executable, "-m", "pip", "install", "pyinstaller"])
print("✓ PyInstaller installed")
def build_executable():
"""Build standalone Neuro executable"""
if not check_pyinstaller():
install_pyinstaller()
print("\n🔨 Building standalone Neuro executable...")
print("This creates a .exe that works WITHOUT Python installed!")
print("=" * 50)
# PyInstaller command
cmd = [
"pyinstaller",
"--onefile", # Single executable
"--name=neuro", # Output name
"--clean", # Clean build
"--noconfirm", # Overwrite without asking
"--add-data=src;src", # Include source code
"--add-data=examples;examples", # Include examples
"--hidden-import=dotenv", # Include hidden imports
"--hidden-import=neuro.interpreter",
"--hidden-import=neuro.parser",
"--hidden-import=neuro.ai_engine",
"neuro" # Main script
]
print(f"\nRunning: {' '.join(cmd)}\n")
try:
subprocess.check_call(cmd)
print("\n" + "=" * 50)
print("✓ BUILD SUCCESSFUL!")
print("=" * 50)
print("\nStandalone executable created:")
print(" Location: dist/neuro.exe")
print(" Size: ~10-20 MB")
print("\nUsage:")
print(" dist\\neuro.exe my_job_search.neuro")
print("\nThis .exe works on ANY Windows machine")
print("WITHOUT Python installed!")
print("\nTo distribute:")
print(" 1. Copy dist/neuro.exe to any Windows machine")
print(" 2. Run: neuro.exe your_file.neuro")
print(" 3. That's it! No Python needed!")
except subprocess.CalledProcessError as e:
print(f"\n❌ Build failed: {e}")
print("\nTroubleshooting:")
print("1. Make sure Python is in PATH")
print("2. Try: pip install pyinstaller --upgrade")
print("3. Run as administrator if permission errors")
if __name__ == "__main__":
print("🧠 Neuro Standalone Builder")
print("Creating native executable with NO Python dependency\n")
build_executable()