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

ModuleNotFoundError: No module named 'win32com' #5071

Open
1 task done
zeldridge opened this issue Mar 12, 2025 · 3 comments
Open
1 task done

ModuleNotFoundError: No module named 'win32com' #5071

zeldridge opened this issue Mar 12, 2025 · 3 comments

Comments

@zeldridge
Copy link

zeldridge commented Mar 12, 2025

Duplicate Check

Describe the bug

Hi,

I have an issue when using my build flet app on Windows. When opening it and I greeted to an error with the error info being

import win32com.client
ModuleNotFoundError: No module named 'win32com'

My app works fine running it in the terminal but for some reason the built flet app hates win32com. And yes, it is in my requirements.txt but that doesn't seem to matter

Code sample

Code
import win32com.client

To reproduce

Add "import win32com.client" to code that is built using Flet

Expected behavior

It is expected to launch like how it does within the terminal but throws an error on the built application

Screenshots / Videos

Captures

Image

Operating System

Windows

Operating system details

Windows 11

Flet version

27.6

Regression

No, it isn't

Suggestions

No response

Logs

Logs
[Paste your logs here]

Additional details

No response

@zeldridge
Copy link
Author

I feel like this issue would be resolved if there was an option in Flet build for --hidden-import like there is for Flet Pack https://flet.dev/docs/reference/cli/pack. Can this option be added for flet build?

@zeldridge
Copy link
Author

I have tried using flet pack over flet build and while the --hidden-import does infact allow me to built my flet app for windows, I much preferred the output of flet build and the way flet pack doesn't really satisfy my needs. Is the hidden import argument able to be added to flet build @ndonkoHenri @FeodorFitsner ?

@zeldridge
Copy link
Author

Can I get any update on support for pywin32 or adding a --hidden-import option to flet build command? I can not use flet currently for my project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant