diff --git a/src/utils.py b/src/utils.py index 86cd8a6..cba3dac 100644 --- a/src/utils.py +++ b/src/utils.py @@ -147,10 +147,9 @@ def base_path(): """ # Get absolute path to resource, works for dev and for PyInstaller if getattr(sys, 'frozen', False): - # PyInstaller creates a temp folder and stores path in _MEIPASS return pathlib.Path(pathlib.sys.executable).parent else: - return pathlib.Path() + return pathlib.Path(os.path.dirname(sys.argv[0])) def resource_path(relative_path: str): @@ -164,10 +163,9 @@ def resource_path(relative_path: str): """ # Get absolute path to resource, works for dev and for PyInstaller if getattr(sys, 'frozen', False): - # PyInstaller creates a temp folder and stores path in _MEIPASS - base_path = pathlib.Path(pathlib.sys._MEIPASS) + base_path = pathlib.Path(pathlib.sys.executable) else: - base_path = pathlib.Path() + base_path = pathlib.Path(os.path.dirname(sys.argv[0])) return base_path / "res" / relative_path