mirror of
https://github.com/brentvollebregt/auto-py-to-exe.git
synced 2026-04-26 12:15:50 +03:00
[GH-ISSUE #195] "Only needed packages" option needed. #176
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 @Drill-N-Bass on GitHub (Sep 4, 2021).
Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/195
Hello,
I have a problem related to this faq.
Quote:
My problem is: when I use another console to avoid additional packages to be installed, then there are some packages that are missing. No matter that I've installed them by this "new console".
So I can either fail with compression in the new console, or compress my file to exe in Anaconda console, but my folder with this compressed program weight - after compression - to almost 1 GB. It should have somethin between 20-70 MB!
Is it possible to add new feature to your program, that would detect any instances of
importcommand in code and include only packages related to this import command? After the commandimportstring, there is always the name of particular packageauto-py-to-execould use. That would solve the whole issue.Or, maybe, before compressing, in this GUI window (auto-py-to-exe) create some sort of string searcher that will search for all instances of "import" strings in code/codes, then thanks to that, find all packages, list them in GUI and ask the user which he/she want to add to output.
This task seems to be doable.
Paul.
@brentvollebregt commented on GitHub (Sep 4, 2021):
Using the new/clean virtual environment, did you run your program to check if it still works in the new environment? With you saying "then there are some packages that are missing", I have a feeling you may have not. I highly recommend testing your application out in the new virtual environment as if it does not work here, it will definitely not worked packaged.
Also another thing to look out for is to make sure you are using the auto-py-to-exe from this new virtual environment and not the auto-py-to-exe from the previous environment that lead to large executable sizes.
In terms of your request for package detection, this is handled by PyInstaller so you will need to raise concerns with that repository. However, your request:
is what PyInstaller does already - there are just some extra hooks that include other imports as libraries do not always use import statements. If PyInstaller did not do this extra searching, most imports or larger libraries would probably lead to broken executables.
In terms of
PyInstaller offers a build-time dependency graph, however they do note that this will show a significant amount of standard modules which can make the output huge. Looking at the output, you could then use the
--exclude-moduleflag to ignore packages you do not want to be added. To get this output, I would recommend using PyInstaller directly using the generated command in auto-py-to-exe.@github-actions[bot] commented on GitHub (Nov 4, 2021):
This issue is stale because it has been open for 60 days with no activity. Remove stale label or comment on this issue or it will be closed in 5 days.
@github-actions[bot] commented on GitHub (Nov 9, 2021):
Closing issue due to no activity in more than 60 days.