Neuling! python Nutzung für MSFS 2024 und GSX pro
Verfasst: Freitag 3. April 2026, 17:28
Hallo!
Habe mir von ChatGpt ein Programm schreiben lassen.
Aufgabe des Programms soll sein eine App (GSX pro) im Flugsimulator per Sprache zu steuern.
Beispiel:
Computer
hört
Boarding
Leider klappt das nicht so wie es soll.
Vor allem diese Zeile bereitet mir Bauchschmerzen
pip install customtkinter SpeechRecognition pyaudio pyttsx3 pyautogui fuzzywuzzy python-Levenshtein
Es kommt nämlich eine Fehlermeldung.
Habe es mit Python 3.14 probiert.
INFO:root:"C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.50.35717\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DMS_WIN64=1 "-IC:\Users\Peter Martin\AppData\Local\Python\pythoncore-3.14-64\include" "-IC:\Users\Peter Martin\AppData\Local\Python\pythoncore-3.14-64\Include" "-IC:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.50.35717\include" "-IC:\Program Files\Microsoft Visual Studio\18\Community\VC\Auxiliary\VS\include" /Tcsrc/pyaudio/device_api.c /Fobuild\temp.win-amd64-cpython-314\Release\src\pyaudio\device_api.obj /MT
cl : Befehlszeile warning D9025 : "/MD" wird durch "/MT" \x81berschrieben
device_api.c
C:\Users\Peter Martin\AppData\Local\Python\pythoncore-3.14-64\include\pyconfig.h(59): fatal error C1083: Datei (Include) kann nicht ge”ffnet werden: "io.h": No such file or directory
error: command 'C:\\Program Files\\Microsoft Visual Studio\\18\\Community\\VC\\Tools\\MSVC\\14.50.35717\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pyaudio
Failed to build pyaudio
error: failed-wheel-build-for-install
× Failed to build installable wheels for some pyproject.toml based projects
╰─> pyaudio
C:\Windows\System32>
Ist jemand so freundlich mir zu erklären was nicht passt?
Vielen Dank für die Hilfe!
Der Code der nach dieser Zeile ausgeführt werden soll ist:
import customtkinter as ctk
import threading
import speech_recognition as sr
import pyautogui
import pyttsx3
import time
from fuzzywuzzy import fuzz
#
Airbus Style
ctk.set_appearance_mode("dark")
ctk.set_default_color_theme("dark-blue")
#
Voice
recognizer = sr.Recognizer()
engine = pyttsx3.init()
WAKE_WORD = "computer"
last_activation = 0
ACTIVE_TIMEOUT = 10
#
Aircraft States
aircraft_state = "AT GATE"
doors = "OPEN"
gpu = "ON"
#
Speak
def speak(text):
log(f"ECAM: {text}")
engine.say(text)
engine.runAndWait()
#
Commands
commands = {
"BOARDING": {
"phrases": ["boarding starten"],
"action": lambda: pyautogui.press('1'),
"state": "BOARDING",
"ecam": "BOARDING IN PROGRESS"
},
"PUSHBACK": {
"phrases": ["pushback starten", "request pushback"],
"action": lambda: pyautogui.press('5'),
"state": "PUSHBACK",
"ecam": "PUSHBACK INITIATED"
},
"STOP": {
"phrases": ["pushback stoppen"],
"action": lambda: pyautogui.press('6'),
"state": "READY",
"ecam": "PUSHBACK COMPLETE"
},
"GPU_OFF": {
"phrases": ["gpu entfernen"],
"action": lambda: pyautogui.press('0'),
"state": "READY",
"ecam": "GPU DISCONNECTED"
},
}
#
Matching
def find_command(text):
best_score = 0
best_cmd = None
for key, data in commands.items():
for phrase in data["phrases"]:
score = fuzz.partial_ratio(text, phrase)
if score > best_score:
best_score = score
best_cmd = key
return best_cmd if best_score > 70 else None
#
Execute
def execute(cmd):
global aircraft_state, gpu
commands[cmd]["action"]()
aircraft_state = commands[cmd]["state"]
if cmd == "GPU_OFF":
gpu = "OFF"
update_ecam(commands[cmd]["ecam"])
update_status()
#
Log
def log(text):
log_box.insert("end", text + "\n")
log_box.see("end")
#
ECAM Display
def update_ecam(text):
ecam_label.configure(text=text)
#
Status Panel
def update_status():
state_label.configure(text=f"STATE: {aircraft_state}")
door_label.configure(text=f"DOORS: {doors}")
gpu_label.configure(text=f"GPU: {gpu}")
#
Voice Loop
def voice_loop():
global last_activation
while True:
with sr.Microphone() as source:
recognizer.adjust_for_ambient_noise(source, duration=0.3)
audio = recognizer.listen(source)
try:
text = recognizer.recognize_google(audio, language="de-DE").lower()
log("YOU: " + text)
now = time.time()
if WAKE_WORD in text:
last_activation = now
speak("Listening")
continue
if now - last_activation < ACTIVE_TIMEOUT:
cmd = find_command(text)
if cmd:
execute(cmd)
else:
speak("NOT RECOGNIZED")
except:
pass
#
UI
app = ctk.CTk()
app.geometry("800x600")
app.title("AIRBUS GSX ECAM")
# ECAM Screen
ecam_label = ctk.CTkLabel(app, text="SYSTEM READY", font=("Courier", 30))
ecam_label.pack(pady=20)
# Status Panel
state_label = ctk.CTkLabel(app, text="STATE: AT GATE")
state_label.pack()
door_label = ctk.CTkLabel(app, text="DOORS: OPEN")
door_label.pack()
gpu_label = ctk.CTkLabel(app, text="GPU: ON")
gpu_label.pack()
# Buttons Panel
frame = ctk.CTkFrame(app)
frame.pack(pady=20)
ctk.CTkButton(frame, text="BOARDING", command=lambda: execute("BOARDING")).grid(row=0, column=0, padx=10, pady=10)
ctk.CTkButton(frame, text="PUSHBACK", command=lambda: execute("PUSHBACK")).grid(row=0, column=1, padx=10, pady=10)
ctk.CTkButton(frame, text="STOP", command=lambda: execute("STOP")).grid(row=1, column=0, padx=10, pady=10)
ctk.CTkButton(frame, text="GPU OFF", command=lambda: execute("GPU_OFF")).grid(row=1, column=1, padx=10, pady=10)
# Log
log_box = ctk.CTkTextbox(app, height=200)
log_box.pack(pady=10, padx=10, fill="both")
# Start Voice Thread
threading.Thread(target=voice_loop, daemon=True).start()
app.mainloop()
Vielen Dank für die Hilfe!
Gruss Peter
Habe mir von ChatGpt ein Programm schreiben lassen.
Aufgabe des Programms soll sein eine App (GSX pro) im Flugsimulator per Sprache zu steuern.
Beispiel:
Computer
hört
Boarding
Leider klappt das nicht so wie es soll.
Vor allem diese Zeile bereitet mir Bauchschmerzen
pip install customtkinter SpeechRecognition pyaudio pyttsx3 pyautogui fuzzywuzzy python-Levenshtein
Es kommt nämlich eine Fehlermeldung.
Habe es mit Python 3.14 probiert.
INFO:root:"C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.50.35717\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DMS_WIN64=1 "-IC:\Users\Peter Martin\AppData\Local\Python\pythoncore-3.14-64\include" "-IC:\Users\Peter Martin\AppData\Local\Python\pythoncore-3.14-64\Include" "-IC:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.50.35717\include" "-IC:\Program Files\Microsoft Visual Studio\18\Community\VC\Auxiliary\VS\include" /Tcsrc/pyaudio/device_api.c /Fobuild\temp.win-amd64-cpython-314\Release\src\pyaudio\device_api.obj /MT
cl : Befehlszeile warning D9025 : "/MD" wird durch "/MT" \x81berschrieben
device_api.c
C:\Users\Peter Martin\AppData\Local\Python\pythoncore-3.14-64\include\pyconfig.h(59): fatal error C1083: Datei (Include) kann nicht ge”ffnet werden: "io.h": No such file or directory
error: command 'C:\\Program Files\\Microsoft Visual Studio\\18\\Community\\VC\\Tools\\MSVC\\14.50.35717\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pyaudio
Failed to build pyaudio
error: failed-wheel-build-for-install
× Failed to build installable wheels for some pyproject.toml based projects
╰─> pyaudio
C:\Windows\System32>
Ist jemand so freundlich mir zu erklären was nicht passt?
Vielen Dank für die Hilfe!
Der Code der nach dieser Zeile ausgeführt werden soll ist:
import customtkinter as ctk
import threading
import speech_recognition as sr
import pyautogui
import pyttsx3
import time
from fuzzywuzzy import fuzz
#
ctk.set_appearance_mode("dark")
ctk.set_default_color_theme("dark-blue")
#
recognizer = sr.Recognizer()
engine = pyttsx3.init()
WAKE_WORD = "computer"
last_activation = 0
ACTIVE_TIMEOUT = 10
#
aircraft_state = "AT GATE"
doors = "OPEN"
gpu = "ON"
#
def speak(text):
log(f"ECAM: {text}")
engine.say(text)
engine.runAndWait()
#
commands = {
"BOARDING": {
"phrases": ["boarding starten"],
"action": lambda: pyautogui.press('1'),
"state": "BOARDING",
"ecam": "BOARDING IN PROGRESS"
},
"PUSHBACK": {
"phrases": ["pushback starten", "request pushback"],
"action": lambda: pyautogui.press('5'),
"state": "PUSHBACK",
"ecam": "PUSHBACK INITIATED"
},
"STOP": {
"phrases": ["pushback stoppen"],
"action": lambda: pyautogui.press('6'),
"state": "READY",
"ecam": "PUSHBACK COMPLETE"
},
"GPU_OFF": {
"phrases": ["gpu entfernen"],
"action": lambda: pyautogui.press('0'),
"state": "READY",
"ecam": "GPU DISCONNECTED"
},
}
#
def find_command(text):
best_score = 0
best_cmd = None
for key, data in commands.items():
for phrase in data["phrases"]:
score = fuzz.partial_ratio(text, phrase)
if score > best_score:
best_score = score
best_cmd = key
return best_cmd if best_score > 70 else None
#
def execute(cmd):
global aircraft_state, gpu
commands[cmd]["action"]()
aircraft_state = commands[cmd]["state"]
if cmd == "GPU_OFF":
gpu = "OFF"
update_ecam(commands[cmd]["ecam"])
update_status()
#
def log(text):
log_box.insert("end", text + "\n")
log_box.see("end")
#
def update_ecam(text):
ecam_label.configure(text=text)
#
def update_status():
state_label.configure(text=f"STATE: {aircraft_state}")
door_label.configure(text=f"DOORS: {doors}")
gpu_label.configure(text=f"GPU: {gpu}")
#
def voice_loop():
global last_activation
while True:
with sr.Microphone() as source:
recognizer.adjust_for_ambient_noise(source, duration=0.3)
audio = recognizer.listen(source)
try:
text = recognizer.recognize_google(audio, language="de-DE").lower()
log("YOU: " + text)
now = time.time()
if WAKE_WORD in text:
last_activation = now
speak("Listening")
continue
if now - last_activation < ACTIVE_TIMEOUT:
cmd = find_command(text)
if cmd:
execute(cmd)
else:
speak("NOT RECOGNIZED")
except:
pass
#
app = ctk.CTk()
app.geometry("800x600")
app.title("AIRBUS GSX ECAM")
# ECAM Screen
ecam_label = ctk.CTkLabel(app, text="SYSTEM READY", font=("Courier", 30))
ecam_label.pack(pady=20)
# Status Panel
state_label = ctk.CTkLabel(app, text="STATE: AT GATE")
state_label.pack()
door_label = ctk.CTkLabel(app, text="DOORS: OPEN")
door_label.pack()
gpu_label = ctk.CTkLabel(app, text="GPU: ON")
gpu_label.pack()
# Buttons Panel
frame = ctk.CTkFrame(app)
frame.pack(pady=20)
ctk.CTkButton(frame, text="BOARDING", command=lambda: execute("BOARDING")).grid(row=0, column=0, padx=10, pady=10)
ctk.CTkButton(frame, text="PUSHBACK", command=lambda: execute("PUSHBACK")).grid(row=0, column=1, padx=10, pady=10)
ctk.CTkButton(frame, text="STOP", command=lambda: execute("STOP")).grid(row=1, column=0, padx=10, pady=10)
ctk.CTkButton(frame, text="GPU OFF", command=lambda: execute("GPU_OFF")).grid(row=1, column=1, padx=10, pady=10)
# Log
log_box = ctk.CTkTextbox(app, height=200)
log_box.pack(pady=10, padx=10, fill="both")
# Start Voice Thread
threading.Thread(target=voice_loop, daemon=True).start()
app.mainloop()
Vielen Dank für die Hilfe!
Gruss Peter