2.8 KiB
2.8 KiB
Important Note About Building Windows Executables
⚠️ Cross-Platform Building Limitation
PyInstaller creates platform-specific executables. This means:
- ❌ You CANNOT build a Windows
.exefrom Linux/Raspberry Pi - ✅ You MUST build on Windows to create a Windows executable
- ✅ You CAN build on Linux to create a Linux executable
Solution: Build on Windows
Option 1: Use a Windows Machine
- Copy all project files to a Windows computer
- Install Python 3.8+ on Windows
- Run the build:
python -m venv venv venv\Scripts\activate pip install -r requirements.txt python build_windows.py
Option 2: Use a Windows Virtual Machine
- Install VirtualBox or VMware
- Create a Windows VM
- Follow the same steps as Option 1
Option 3: Use Wine (Advanced, Not Recommended)
Wine can sometimes work but is unreliable for Kivy applications.
What You CAN Do on Raspberry Pi/Linux
1. Build Linux Executable
source venv/bin/activate
pip install pyinstaller
pyinstaller --onefile --windowed main.py
This creates: dist/main (Linux executable)
2. Run Directly with Python (Recommended for Development)
source venv/bin/activate
python main.py
3. Transfer Files to Windows for Building
Use:
- USB drive
- Network share
- Git repository
- Cloud storage (Dropbox, Google Drive, etc.)
Recommended Workflow
For Distribution:
- Develop on Raspberry Pi/Linux (as you're doing now)
- When ready to distribute, transfer project to Windows
- Build Windows executable on Windows machine
- Distribute the
.exefile to end users
For Testing:
- Keep developing and testing with
python main.pyon your Raspberry Pi - The app works perfectly without building an executable
Alternative: Distribute as Python App
Instead of an executable, you can distribute:
-
Python files + instructions
- Give users: main.py, database_manager.py, requirements.txt - Users install Python and run: pip install -r requirements.txt && python main.py -
Docker container (works on any platform)
docker build -t database-app . docker run database-app
Files Ready for Windows Build
✅ All necessary files are ready:
build_windows.py- Automated build scriptbuild.bat- Windows batch fileDatabaseApp.spec- PyInstaller configurationBUILD_WINDOWS_GUIDE.md- Complete instructionsmain.py- Main applicationdatabase_manager.py- Database logicrequirements.txt- Dependencies
Just transfer these files to Windows and run build.bat
Questions?
- The app works perfectly as-is with Python on any platform
- Building executables is only needed for distribution to users without Python
- For personal use or development, keep using
python main.py