EmuGUI icon indicating copy to clipboard operation
EmuGUI copied to clipboard

first time using EmuGUI python path error(?)

Open SayaAEP opened this issue 7 months ago • 6 comments

it my first time gonna use qemu

C:\Users\sayaaep>C:\Users\sayaaep\Desktop\EmuGUI_v2.0.10.5621_Win_amd64\emugui.exe
C:\Users\sayaaep\Desktop\EmuGUI_v2.0.10.5621_Win_amd64\_internal\services\pathfinder.pyc
C:\Users\sayaaep\Desktop\EmuGUI_v2.0.10.5621_Win_amd64\
2025-04-20
EmuGUI 2.0.10.5621
Current date: 2025-06-10
OS: Windows 10, Version 10.0.19045
CPU: 12x AMD64 Family 25 Model 68 Stepping 1, AuthenticAMD @3.22 GHz (AMD64)
RAM: 16450318336 bytes (15.32 GB)
Python: 3.12.9 tags/v3.12.9, compiled with MSC v.1942 64 bit (AMD64)
Traceback (most recent call last):
  File "errors\logman.py", line 36, in writeToLogFile
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\hazel\\Documents\\EmuGUI\\log-qtlbbh569epf16199tdhzi8mbornoidk.txt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "emugui.py", line 3768, in <module>
  File "emugui.py", line 171, in __init__
  File "errors\logman.py", line 42, in writeToLogFile
  File "platformSpecific\windowsSpecific.py", line 68, in windowsCreEmuGUIFolder
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\hazel\\Documents\\EmuGUI'
[PYI-7100:ERROR] Failed to execute script 'emugui' due to unhandled exception!
C:\Users\sayaaep\Desktop\EmuGUI_v2.0.10.5621_Win_amd64>emugui.exe
C:\Users\sayaaep\Desktop\EmuGUI_v2.0.10.5621_Win_amd64\_internal\services\pathfinder.pyc
C:\Users\sayaaep\Desktop\EmuGUI_v2.0.10.5621_Win_amd64\
2025-04-20
EmuGUI 2.0.10.5621
Current date: 2025-06-10
OS: Windows 10, Version 10.0.19045
CPU: 12x AMD64 Family 25 Model 68 Stepping 1, AuthenticAMD @3.22 GHz (AMD64)
RAM: 16450318336 bytes (15.32 GB)
Python: 3.12.9 tags/v3.12.9, compiled with MSC v.1942 64 bit (AMD64)
Traceback (most recent call last):
  File "errors\logman.py", line 36, in writeToLogFile
    with open(self.logFile, "a+") as logger:
         ^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\hazel\\Documents\\EmuGUI\\log-qpm35z3y44tcetlc1ku2hcbau1lgyga4.txt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "emugui.py", line 3768, in <module>
    win = Window()
          ^^^^^^^^
  File "emugui.py", line 171, in __init__
    logman.writeToLogFile(f"{errors.errCodes.errCodes[38]}: Running EmuGUI {self.version}")
  File "errors\logman.py", line 42, in writeToLogFile
    platformSpecific.windowsSpecific.windowsCreEmuGUIFolder()
  File "platformSpecific\windowsSpecific.py", line 68, in windowsCreEmuGUIFolder
    os.mkdir(f"C:\\Users\\{userName}\\Documents\\EmuGUI")
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\hazel\\Documents\\EmuGUI'
[PYI-19360:ERROR] Failed to execute script 'emugui' due to unhandled exception!

C:\Users\sayaaep\Desktop\EmuGUI_v2.0.10.5621_Win_amd64>

SayaAEP avatar Jun 10 '25 15:06 SayaAEP

Image Image

C:\Users\sayaaep\Desktop\EmuGUI_v2.0.10.5621_Win_amd64>whoami
hazelqwq\hazel

okay i noticed something how about the code you made was reading current username. somehow i've changed my username but the C:\Users\sayaaep not changed into C:\Users\hazel for some reason

SayaAEP avatar Jun 10 '25 15:06 SayaAEP

Can you please try the EmuGUI Pre-Release?

Tech-FZ avatar Jun 13 '25 16:06 Tech-FZ

I believe this issue stems from the way you're getting the user home in Windows. When inside a domain, the user folder may be different from the username.

This gives the correct home location:

from pathlib import Path
home = Path.home()

Usage:

os.mkdir(home / "EmuGUI")
fileName = home / "EmuGUI" / f"log-{logID}.txt"

I'm inside a domain called HOFFICE, this is my output in Windows for username and for the user folder:

>echo %USERNAME%
myuser

>echo %USERPROFILE%
C:\Users\myuser.HOFFICE

>echo %USERDOMAIN%
HOFFICE

So concatenating "C:\users\{username}" throws the same error in this post for me.

I'm unable to open a PR at the moment, but the file that should be changed is platformSpecific/windowsSpecific.py

styper avatar Jun 24 '25 20:06 styper

Did you test EmuGUI 2.1? I remember to have it fixed there...

Tech-FZ avatar Jun 25 '25 11:06 Tech-FZ

Can you please try the EmuGUI Pre-Release?

okay let me test latest preview you made

pardon being late to reply

SayaAEP avatar Jun 28 '25 12:06 SayaAEP

Basically, EmuGUI isn't detecting the correct user path, as @styper explained. However, with the working pre-release, this issue seems to be resolved for now.

I believe this issue stems from the way you're getting the user home in Windows. When inside a domain, the user folder may be different from the username.

>echo %USERNAME%
myuser

>echo %USERPROFILE%
C:\Users\myuser.HOFFICE

>echo %USERDOMAIN%
HOFFICE

So concatenating "C:\users{username}" throws the same error in this post for me.

C:\Users\sayaaep>echo %USERNAME%
'hazel' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\sayaaep>echo %USERPROFILE%
'C:\Users\sayaaep' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\sayaaep>

So yes, it's working on the pre-release.

However, I still have to set the QEMU path manually: Image

My second issue is that EmuGUI isn’t detecting the QEMU path even though I’ve already added it to the system variables: Image

It would be a great improvement if EmuGUI could automatically detect the QEMU path from the system environment variables, so users don’t have to specify it manually.

SayaAEP avatar Jun 28 '25 13:06 SayaAEP