[GH-ISSUE #372] How can I add only those libraries that I need and ignore all others? #305

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

Originally created by @Cowboyserg on GitHub (Mar 2, 2023).
Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/372

Originally assigned to: @Cowboyserg on GitHub.

Windows 10
Python 3.7
auto-py-to-exe 2.18.2

Hello, can you help me with my problem please?
I used command

pyinstaller --noconfirm --onefile --console --debug "all" --hidden-import "openpyxl" --hidden-import "uuid" --exclude-module "Django" --exclude-module "matplotlib"  "generate.py"

I have only 2 import in my .py file

from openpyxl import Workbook
import uuid

I don't know why, but auto-py-to-exe tryed to take Django and matplotlib. That is the reason why I added them to --exclude-module.
How can I add only this 2 libraries into exe file and ignore all other, that auto-py-to-exe takes?

In the end I got my exe file that works correct, but it weighs 140 MB

Originally created by @Cowboyserg on GitHub (Mar 2, 2023). Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/372 Originally assigned to: @Cowboyserg on GitHub. Windows 10 Python 3.7 auto-py-to-exe 2.18.2 Hello, can you help me with my problem please? I used command ``` pyinstaller --noconfirm --onefile --console --debug "all" --hidden-import "openpyxl" --hidden-import "uuid" --exclude-module "Django" --exclude-module "matplotlib" "generate.py" ``` I have only 2 import in my `.py` file ``` from openpyxl import Workbook import uuid ``` I don't know why, but `auto-py-to-exe` tryed to take Django and matplotlib. That is the reason why I added them to `--exclude-module`. How can I add only this 2 libraries into `exe` file and ignore all other, that `auto-py-to-exe` takes? In the end I got my `exe` file that works correct, but it weighs 140 MB
kerem 2026-02-26 12:21:09 +03:00
Author
Owner

@github-actions[bot] commented on GitHub (Mar 2, 2023):

👋 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:1451995587 --> @github-actions[bot] commented on GitHub (Mar 2, 2023): 👋 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

@brentvollebregt commented on GitHub (Mar 2, 2023):

In the post that's linked in the README, at the bottom of the UI after every build and in the comment above, there is a section "The Output Executable is Huge". Give this a read - you need to use a virtual environment to remove these extra libraries from your environment.

<!-- gh-comment-id:1452447840 --> @brentvollebregt commented on GitHub (Mar 2, 2023): In the post that's linked in the README, at the bottom of the UI after every build and in the comment above, there is a section ["The Output Executable is Huge"](https://nitratine.net/blog/post/issues-when-using-auto-py-to-exe/#the-output-executable-is-huge). Give this a read - you need to use a virtual environment to remove these extra libraries from your environment.
Author
Owner

@github-actions[bot] commented on GitHub (Apr 2, 2023):

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.

<!-- gh-comment-id:1493189100 --> @github-actions[bot] commented on GitHub (Apr 2, 2023): 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.
Author
Owner

@github-actions[bot] commented on GitHub (Apr 8, 2023):

Closing issue due to no activity in more than 60 days.

<!-- gh-comment-id:1500748542 --> @github-actions[bot] commented on GitHub (Apr 8, 2023): Closing issue due to no activity in more than 60 days.
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#305
No description provided.