[Question] I'm encountering a ModuleNotFoundError "wsgiref" when running my Flet app after building: #4657
Replies: 2 comments 2 replies
-
Could be a hidden import causing the issue. I've had a similar issue on windows trying to build with Langchain libraries. Try adding the package to your requirements file, and even just importing it near the entry point of you application. |
Beta Was this translation helpful? Give feedback.
-
I hit this problem on Flet 0.27.1 and came across a workaround. For some reason Flet's build process isn't recognizing In my local copy of from . import handlers
from . import headers
from . import simple_server
from . import types
from . import util
from . import validate
all = ['handlers', 'headers', 'simple_server', 'types', 'util', 'validate'] and change one import in my from And then in my import sys
from vendor import v_wsgiref
sys.modules["wsgiref"] = v_wsgiref This workaround gets me a functional app, yet it is really weird why Flet would not include wsgiref by default. It's really weird why this would be happening. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Simple flet project but error occurs.
test_wsgiref.zip
Question
Error Title
ModuleNotFoundError: No module named 'wsgiref'
Environment
Steps to Reproduce
flet build macos --project myAppName --copyright myName --build-version 0.1.0
Expected Behavior
The application should start normally without any module import errors.
Additional Context
Questions
Code sample
Error message
files
main.py
pyproject.toml
------------------------------------------------------
Beta Was this translation helpful? Give feedback.
All reactions