#🔒 i can launch a exe as normally but not when launching it from a GUI with tkinter.

15 messages · Page 1 of 1 (latest)

lone mauve
#

Hello! I have a .exe that can be executed as normally without problems, but when `trying to launch it from a gui, i get this error:

stderr: Traceback (most recent call last):
stdout: Logged in!
stderr: File "nextbot.py", line 50, in <module>
stderr: File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
stderr: File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
stderr: File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
stderr: File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
stderr: File "rlsdk_python\__init__.py", line 1, in <module>
stderr: from .sdk import RLSDK
stderr: File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
stderr: File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
stderr: File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
stderr: File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
stderr: File "rlsdk_python\sdk.py", line 15, in <module>
stderr: from .events import EventFunctionHooked, EventBoostPadChanged, EventTypes, EventPlayerTick, EventRoundActiveStateChanged, EventResetPickups, EventGameEventStarted, EventKeyPressed, EventGameEventDestroyed
stderr: File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
stderr: File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
stderr:   File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked```
waxen yewBOT
#

@lone mauve

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

lone mauve
#
def run_exe(exe_path, minimap_status, bot_type, update_output, selected_pid):
    global bot_process

    command = [exe_path, "--kickoff"]

    if minimap_status:
        command.append("--minimap")

    command.extend(["-b", bot_type, "-p", selected_pid])
    print(f"Executing command: {command}")  # Imprime el comando para depuración

    try:
        bot_process = subprocess.Popen(
            command,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            text=True,
            bufsize=1,
            creationflags=subprocess.CREATE_NO_WINDOW
        )
        print("Process started successfully")
    except Exception as e:
        print(f"Error starting process: {e}")
        return```
noble kelp
#

what's the entire error?

lone mauve
#

that's it

#

I'm not receiving more

lone mauve
noble kelp
#

what's the exe?

lone mauve
#

that works on freeplay and private matchs

#

it works well when launching the exe normally with for example "nextbot.exe -b bot -p pid"

lone mauve
# noble kelp what's the exe?

run_exe is called here:

def start_bot(root):
    global minimap_status, stop_button, launch_button, selected_pid
    bot_exe_path = get_exe_path()
    selected_bot_key = bot_var.get()
    selected_pid = str(pid_option_menu.get())  # Convertir el PID a cadena
    selected_bot_value = bot_map.get(selected_bot_key, selected_bot_key)

    # Imprimir el tipo y valor de selected_pid para depuración
    print(f"Tipo de selected_pid: {type(selected_pid)}")
    print(f"Valor de selected_pid: {selected_pid}")

    minimap_status = minimap_status  # Asegúrate de que esta variable esté definida y tenga un valor adecuado

    # Pasar el PID como cadena a run_exe
    bot.run_exe(bot_exe_path, minimap_status, selected_bot_value, update_output, selected_pid)

    # Mostrar el botón "Stop" y ocultar el botón "Launch"
    stop_button.pack(pady=5, padx=10)
    launch_button.pack_forget()
    
    # Iniciar el monitoreo del archivo de log
    log_file_path = os.path.join(tempfile.gettempdir(), 'ZC10491-output.log')
    start_log_monitor(log_file_path, update_output)```
#

@noble kelp Sorry for ping if it anoys you, u think u could help me with that? I was trying to fix this problem for 2 days now with almost no sleep

waxen yewBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.