mirror of
https://github.com/brentvollebregt/auto-py-to-exe.git
synced 2026-04-26 20:25:50 +03:00
[GH-ISSUE #116] Automatically ignore __pycache__ folders? #109
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ganego on GitHub (Aug 12, 2020).
Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/116
So with the ´pycache ` folder being for compiled python code, it seems to not make sense to bundle code that was compiled with my Python version and my Windows version to a package I'd distribute - right?
Happens when I add a folder.
Can those files actually even be used with the exe? If so, maybe it would make sense?
But I never see those files being created by the exe.
Or is this byte-code already put in the exe? But then why would I still need to include the folders with my other .py files.
So I guess the exe does not use compiled python code?
Is there an automatic way to ignore it (did not find one), or do I have to remove it manually after packaging the .exe?
Thank you
@brentvollebregt commented on GitHub (Aug 12, 2020):
auto-py-to-exe uses PyInstaller for packaging, so taking a read of the docs I found:
Taking a look inside the
base_library.zipfile generated (can easily be seen in one-folder mode) it's clear that PyInstaller has packaged .pyc files rather than .py files.Why does it not make sense to package these compiled scripts? Yes, they may have been created with the specific version of Python you used to package, but the exact same interpreter that created them will be packaged with the pyc files. In terms of the OS compatibility, I have only seen architecture be an issue and I believe that is due to something other than complied Python scripts.
I haven't seen a flag or option to stop using pyc files before - most likely because pyc files are faster and they run just as fine.
@ganego commented on GitHub (Aug 12, 2020):
I tested and the pyc files - that are in a separate included folder - are accessed when the exe loads. But I just had another idea and I did another test to check if they are actually used, and it seems they are in fact used when running the exe. For that I simply deleted parts of the pyc file from the included folder and once this code was supposed to be called, the app crashed.
Traceback