This guide will help you create a standalone Windows executable for the FloorPlan Converter application.
- Python Environment: Make sure you have Python 3.8+ installed
- Dependencies: Install all required packages
- PyInstaller: Install PyInstaller for building executables
-
Run the automated build script:
python build_executable.py
-
Create distribution package:
python create_distribution.py
- Run the simple batch file:
build_simple.bat
# Install all required packages
pip install -r requirements.txt
# Ensure PyInstaller is installed
pip install pyinstallerMake sure these directories exist:
src/- Contains your source codemodels/- Contains ML models (if any)build/- Contains compiled models (if any)outputs/- Will be created automatically
python build_executable.pybuild_simple.batpyinstaller --onefile --windowed --name=FloorPlanConverter --add-data="src;src" --add-data="models;models" --hidden-import=gradio --hidden-import=matplotlib --hidden-import=onnxruntime --hidden-import=torch --hidden-import=cv2 --hidden-import=PIL --hidden-import=ezdxf app_local.py- Navigate to the
distfolder - Run
FloorPlanConverter.exe - Open your browser to
http://localhost:7860 - Test both processing modes:
- Hand-drawn sketch processing
- PNG image processing
python create_distribution.pyThis will create:
FloorPlanConverter_v1.0/folder with all necessary filesFloorPlanConverter_v1.0.zipfor easy distribution
dist/
├── FloorPlanConverter.exe # Main executable
├── README.txt # User instructions
└── FloorPlanConverter_v1.0/ # Distribution folder
├── FloorPlanConverter.exe
├── launch_converter.bat
├── README.txt
├── outputs/ # Output directory
└── sample_inputs/ # Sample images
-
"Failed to execute script"
- Remove
--windowedflag to see console output - Check for missing dependencies
- Remove
-
Missing DLL files
- Use
--collect-allflag - Manually add missing DLLs to the build
- Use
-
Large file size
- Use
--exclude-modulefor unused libraries - Consider using
--onedirinstead of--onefile
- Use
-
Slow startup
- This is normal for the first launch
- Subsequent launches should be faster
To see console output and debug issues:
- Edit
build_executable.py - Remove
"--windowed"from the cmd list - Rebuild the executable
For smaller executables, modify the build command:
pyinstaller --onefile --strip --exclude-module=pytest --exclude-module=jupyter --name=FloorPlanConverter app_local.py- Share the zip file:
FloorPlanConverter_v1.0.zip - Instructions for users:
- Extract the zip file
- Run
FloorPlanConverter.exe - Open browser to
http://localhost:7860
- Test on clean Windows machine
- Test without internet connection
- Test both processing modes
- Verify all features work correctly
You can modify build_executable.py to add custom options:
# Add custom hidden imports
"--hidden-import=custom_module",
# Exclude unused modules
"--exclude-module=unused_module",
# Add custom data files
"--add-data=custom_data;custom_data",Set these environment variables for better control:
# Disable console window
PYINSTALLER_WINDOWED=1
# Enable debug mode
PYINSTALLER_DEBUG=1If you encounter issues:
- Check the console output (remove
--windowedflag) - Verify all dependencies are installed
- Test on a clean Windows machine
- Check PyInstaller documentation for specific error messages
- v1.0: Initial release with hand-drawn sketch and PNG processing support