- Windows 10 or 11
- Python 3.8 or higher (Download from python.org)
- ✅ Make sure to check "Add Python to PATH" during installation
- Open Command Prompt as Administrator and install pipenv:
pip install pipenv
- Clone or download the repository and navigate to the project folder:
cd path\to\project
- Create virtual environment and install dependencies:
pipenv install
- Activate the virtual environment:
pipenv shell
- Install PyInstaller in your virtual environment:
pipenv install pyinstaller
- For Windows GUI applications, use this command:
pyinstaller --noconfirm --onefile --windowed --icon=assets/icon.ico --name "App Name" main.py
Or if you have a spec file:
pyinstaller app.spec
The executable will be created in the dist
folder.
--noconfirm
: Replace output directory without asking--onefile
: Create single .exe file--windowed
: Hide console window when running--icon
: Set .exe icon--name
: Set output .exe name
-
"Python is not recognized as an internal or external command"
- Solution: Reinstall Python with "Add Python to PATH" checked
- Or manually add Python to System Environment Variables
-
Missing DLL errors
- Install Visual C++ Redistributable:
- Download from Microsoft's website
-
Anti-virus flags the .exe
- Add exclusion for your development folder
- Use
--key
option with PyInstaller to sign your executable
# Create new environment
pipenv install
# Activate environment
pipenv shell
# Install new package
pipenv install package_name
# Build exe
pyinstaller app.spec
# Clean build files
rmdir /s /q build
rmdir /s /q dist
del *.spec
project/
│
├── main.py
├── Pipfile
├── Pipfile.lock
├── assets/
│ └── icon.ico
├── build/
└── dist/
└── App.exe