Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relative Paths aren't resolved until in the temp directory #486

Open
3 tasks done
adalfarus opened this issue May 22, 2024 · 4 comments
Open
3 tasks done

Relative Paths aren't resolved until in the temp directory #486

adalfarus opened this issue May 22, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@adalfarus
Copy link

adalfarus commented May 22, 2024

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
@adalfarus adalfarus added the bug Something isn't working label May 22, 2024
Copy link

👋 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.

@adalfarus
Copy link
Author

adalfarus commented 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.

@brentvollebregt
Copy link
Owner

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 👌

@brentvollebregt
Copy link
Owner

brentvollebregt commented 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.

brentvollebregt added a commit that referenced this issue Jun 1, 2024
brentvollebregt added a commit that referenced this issue Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants