Repository navigation
bug: Windows build fails silently in Flet 1.0.5 packaging stage and produces incomplete Python runtime (missing dependencies such as certifi) #7029
Description
Duplicate Check
- I have searched the opened issues and there are no duplicates
Describe the bug
Environment:
OS:
Windows 11 25H2
Build 10.0.26200.9711
Python:
3.14.7
Flet:
1.0.5
flet-cli:
1.0.5
Flutter:
3.44.8 (stable)
Dart:
3.12.2
Visual Studio:
2022 Community 17.14.33
Android SDK:
36.1.0
Note: flutter doctor reports: No issues found.
Summary
flet build windows --python-version 3.14 -v fails with:
Error building Flet app - see the log of failed command above.
However, no failed command, exception, or traceback is shown.
The generated Flutter project builds successfully with:
flutter build windows -v
...and exits successfully.
The generated executable launches, but fails immediately with:
ModuleNotFoundError: No module named 'certifi'
...indicating that Python dependencies were never installed into the packaged runtime.
Code sample
Code
[Paste your code here]To reproduce
Project
Python extension package:
TOML:
[project]
requires-python = ">=3.14,<3.15"
dependencies = [
"flet==1.0.5",
"httpx==0.28.1",
"certifi==2026.10.23",
]
Example application:
TOML:
dependencies = [
"test-extension-26",
"flet==1.0.5",
]
Flutter package:
YAML:
environment:
sdk: ">=3.12.2 <3.13.0"
flutter: ">=3.44.8 <3.45.0"
dependencies:
flutter:
sdk: flutter
flet: 1.0.5
image_painter: 0.7.1
fleather: 1.28.0
parchment: 1.27.0
display_metrics: 2.6.0
Build Command:
flet build windows --python-version 3.14 -v
Expected behavior
- Build completes successfully, installing all declared Python dependencies into the bundled runtime.
...or:
- Build fails with the underlying exception and full traceback.
Actual Behavior:
Build fails with a generic message:
Error building Flet app - see the log of failed command above.
...while:
- No actual failing command is displayed,
- No traceback is displayed,
- Generated Flutter project builds successfully,
- Bundled runtime is missing required dependencies.
Build output reaches:
_Running package command
Python 3.14 (CPython 3.14.7)
Compiling Python sources in a temp directory_
...and later:
flutter doctor
...
No issues found!
...but then ends with:
Error building Flet app - see the log of failed command above.
No actual failed command is shown.
Screenshots / Videos
Captures
[Upload media here]
Operating System
Windows
Operating system details
Windows 11
Flet version
1.0.5
Regression
No, it isn't
Suggestions
No response
Logs
Logs
[Paste your logs here]Additional details
The generated Flutter project is fully created under:
build\flutter
...and can be built manually:
_cd build\flutter
flutter build windows -v_
Result:
Build succeeded.
0 Warning(s)
0 Error(s)
Packaged Runtime Missing Dependencies
Inside:
build\flutter\build\build_python_3.14.7\python
...the bundled runtime cannot import certifi:
python.exe -c "import certifi"
Output:
ModuleNotFoundError: No module named 'certifi'
Inspection of:
Lib\site-packages
...shows essentially only:
pip
pip-*.dist-info
...and none of the required runtime dependencies.
Expected packages such as:
certifi
httpx
oauthlib
repath
msgpack
...are absent.
Potentially Related Observation:
Verbose build output contains:
-r flet==1.0.5
-r test-extension-26 @ file:///C:/flutter/extension26
-r --no-cache-dir
The final entry appears suspicious:
-r --no-cache-dir
...as -r normally precedes a requirement specifier.
This may indicate malformed argument construction during the packaging step.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fields🔖 Ready
Activity
nelson-python commentedon Oct 31, 2026
Possibly related to #6994.
Observed symptom is nearly identical:
Difference:
Issue reproduced on Windows build path rather than APK build path.
Nelson
ndonkoHenri commentedon Oct 31, 2026
Thanks for the detailed report and the log, they made this easy to pin down.
The build stops at the step that pre-compiles your app's
.pyfiles (thepython -m compileallline at the end of your log), before any dependencies are installed. That's whysite-packagesonly holds pip, and why the app you built by hand withflutter build windowscan't importcertifi. The-r --no-cache-direntry is expected:--no-cache-diris passed through to pip.The compile step fails because one of the
.pyfiles in your app directory can't be compiled, usually because of a syntax error, or syntax that Python 3.14 doesn't accept. With-v, Flet doesn't show that error, which is a bug on our side.Workaround: run the build with
-vvto see the error:Right after the
compileallline you'll find the file, the line number and aSyntaxError. Then either:--exclude <path>, or withexcludeunder[tool.flet.app]inpyproject.toml.The next build then installs your dependencies as usual. If
-vvshows something else, please attach that log.The fix is in flet-dev/serious-python#262:
flet buildwill print the error without-vv.Show a failed command's output without --verbose; bump to 6.1.3 (#262)
nelson-python commentedon Nov 1, 2026
@ndonkoHenri
As an update, the root cause was identified.
The build failure was caused by an old Python file in my backup folder (for old versions of code) under the app source tree. Running with -vv revealed IndentationError in the old/archived file. After removing/moving the backup file outside the app path, the build completed successfully.
The issue regarding hidden compile errors remains valid, and the fix in serious_python#262 appears to address the discoverability problem.
Thank you,
Nelson