[GH-ISSUE #486] Relative Paths aren't resolved until in the temp directory #379

Closed
opened 2026-02-26 12:21:25 +03:00 by kerem · 5 comments
Owner

Originally created by @adalfarus on GitHub (May 22, 2024).
Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/486

Originally assigned to: @brentvollebregt on GitHub.

Quick Checks

  • I have read the help post
  • I have searched other issues, looking for an issue similar to mine
  • I have made sure my application/script runs before trying to package

Describe the bug

Relative paths to resources aren't resolved until it's compiling which usually isn't the indented usage.

To Reproduce

  1. Open Auto-Py-To-Exe and setup some basic settings
  2. Use relative paths for extra files, icon, ...
  3. Compile and see an error similar to : "Compilation stopping, couldn't find ..../temp_18275/data"

Expected behavior

It should resolve all relative paths and then start the compilation process.

Your Environment:

  • Python version (python --version): 3.12.0
  • auto-py-to-exe version (pip show auto-py-to-exe): 2.43.3
  • PyInstaller version (pip show pyinstaller): 6.7.0
  • Eel version (pip show eel): 0.16.0
Originally created by @adalfarus on GitHub (May 22, 2024). Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/486 Originally assigned to: @brentvollebregt on GitHub. **Quick Checks** - [x] I have read the [help post](https://nitratine.net/blog/post/issues-when-using-auto-py-to-exe) - [x] I have [searched other issues](https://github.com/brentvollebregt/auto-py-to-exe/issues?q=is%3Aissue+), looking for an issue similar to mine - [x] I have made sure my application/script runs before trying to package **Describe the bug** Relative paths to resources aren't resolved until it's compiling which usually isn't the indented usage. **To Reproduce** 1. Open Auto-Py-To-Exe and setup some basic settings 2. Use relative paths for extra files, icon, ... 3. Compile and see an error similar to : "Compilation stopping, couldn't find ..../temp_18275/data" **Expected behavior** It should resolve all relative paths and then start the compilation process. **Your Environment:** - Python version (`python --version`): 3.12.0 - auto-py-to-exe version (`pip show auto-py-to-exe`): 2.43.3 - PyInstaller version (`pip show pyinstaller`): 6.7.0 - Eel version (`pip show eel`): 0.16.0
kerem 2026-02-26 12:21:25 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@github-actions[bot] commented on GitHub (May 22, 2024):

👋 Hi, just a reminder that if you haven't read the help post yet, give it a read to see if your issue is covered in it and make sure to follow the debugging section.

Also please note, as stated in the README, if your issue is only associated with your application and not auto-py-to-exe itself, please do not create an issue in this repository - instead, comment on the help post, video or create a new discussion.

<!-- gh-comment-id:2123928097 --> @github-actions[bot] commented on GitHub (May 22, 2024): 👋 Hi, just a reminder that if you haven't read [the help post](https://nitratine.net/blog/post/issues-when-using-auto-py-to-exe/) yet, give it a read to see if your issue is covered in it and make sure to follow [the debugging section](https://nitratine.net/blog/post/issues-when-using-auto-py-to-exe/#debugging). Also please note, as stated in the README, if your issue is only associated with your application and not auto-py-to-exe itself, please do not create an issue in this repository - instead, comment on the help [post](https://nitratine.net/blog/post/issues-when-using-auto-py-to-exe/), [video](https://youtu.be/OZSZHmWSOeM) or create a [new discussion](https://github.com/brentvollebregt/auto-py-to-exe/discussions).
Author
Owner

@adalfarus commented on GitHub (May 22, 2024):

The reason I'm not posting this to pyinstaller is because that is a commandline tool. You can change the arguments and resolve relative paths using a script file, but auto-py-to-exe can only accept predefined settings using a json file, so doing it like that is a lot harder and more error prone.

<!-- gh-comment-id:2123930185 --> @adalfarus commented on GitHub (May 22, 2024): The reason I'm not posting this to pyinstaller is because that is a commandline tool. You can change the arguments and resolve relative paths using a script file, but auto-py-to-exe can only accept predefined settings using a json file, so doing it like that is a lot harder and more error prone.
Author
Owner

@brentvollebregt commented on GitHub (May 25, 2024):

Thanks for raising this - I see how this could be an issue.

Looks like I need to add a function like convert_path_to_absolute to the window to help with generating the current command. Will fix this when I get some time next 👌

<!-- gh-comment-id:2131223229 --> @brentvollebregt commented on GitHub (May 25, 2024): Thanks for raising this - I see how this could be an issue. Looks like I need to add a function like `convert_path_to_absolute` to the window to help with generating the current command. Will fix this when I get some time next 👌
Author
Owner

@brentvollebregt commented on GitHub (Jun 1, 2024):

Ah yes, I see PyInstaller makes the icon relative to the .spec file if it is provided as a relative path; see here. Since we make the .spec file generate in a temporary directory, it's making the calculated path relative to the temporary directory - which is not what we want.

Doesn't look like we can do any path magic, will need to go with a function like convert_path_to_absolute as described above before creating the current command.

<!-- gh-comment-id:2143262832 --> @brentvollebregt commented on GitHub (Jun 1, 2024): Ah yes, I see PyInstaller makes the icon relative to the .spec file if it is provided as a relative path; [see here](https://github.com/pyinstaller/pyinstaller/blob/3fa81817d8bdd1e84f77139d8d878a85831b9173/PyInstaller/building/api.py#L570). Since we make the .spec file generate in a temporary directory, it's making the calculated path relative to the temporary directory - which is not what we want. Doesn't look like we can do any path magic, will need to go with a function like `convert_path_to_absolute` as described above before creating the current command.
Author
Owner

@brentvollebregt commented on GitHub (Jun 21, 2024):

This should be fixed in #493 - drop a comment here if there is still an issue around this.

<!-- gh-comment-id:2182631656 --> @brentvollebregt commented on GitHub (Jun 21, 2024): This should be fixed in #493 - drop a comment here if there is still an issue around this.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/auto-py-to-exe#379
No description provided.