A complete, step-by-step guide covering every feature of the app.
- Launching the App
- The Splash Screen
- Understanding the Interface
- Section 01 — Select Files
- Section 02 — Build Options
- Section 03 — Additional Files
- Section 04 — Python Interpreter
- The CONVERT Button
- The Build Log
- After a Successful Build
- Basic Conversion — Step by Step
- Advanced Conversion — Step by Step
- Common Errors and How to Fix Them
- Pro Tips
Open Command Prompt (Win + R → type cmd → Enter) and run:
python py2exe_converter.pyOr right-click the file in Explorer → Open with Python.
Every time you open PyToExe, a terminal-style splash screen appears:
██████╗ ██╗ ██╗ ██████╗ ███████╗██╗ ██╗███████╗
...
Python --> EXE Converter v2.1
Author : Instagram @x404ctl | GitHub @MAliXCS
──────────────────────────────────────────────────────────
[ * ] Initializing runtime environment ...
[ * ] Locating Python interpreter ...
[ * ] Loading PyInstaller interface ...
[ * ] Configuring build workspace ...
[ * ] All systems ready.
──────────────────────────────────────────────────────────
Press any key to continue ..._
How to dismiss it:
- Press any key on your keyboard, OR
- Click anywhere on the splash window
The main app opens immediately after.
The app is divided into 5 numbered sections plus a CONVERT button, progress bar, and status bar:
┌─────────────────────────────────────────────────────┐
│ TITLE BAR ( app name + author ) │
├─────────────────────────────────────────────────────┤
│ 01 / Select Files ← your .py, output, icon│
│ 02 / Build Options ← one-file, windowed │
│ 03 / Additional Files ← bundle extra data │
│ 04 / Python Interpreter ← shows python.exe path │
├─────────────────────────────────────────────────────┤
│ [ CONVERT .py --> .exe ] ← THE BIG BUTTON │
│ [progress bar] [Clear Log] │
│ [ Open Output Folder ] ← appears after success │
├─────────────────────────────────────────────────────┤
│ 05 / Build Log ← live build output │
├─────────────────────────────────────────────────────┤
│ STATUS BAR ( coloured dot + message ) │
└─────────────────────────────────────────────────────┘
| Status Dot Colour | Meaning |
|---|---|
| Grey | Ready / idle |
| Blue | Build in progress |
| Green | Build succeeded |
| Orange | Build finished but something is off (antivirus?) |
| Red | Build failed |
This section has three fields:
Click Browse → navigate to your .py or .pyw file → click Open.
The path fills in automatically. The Output Folder also auto-fills to a dist/ folder next to your script (you can change it).
Your script must be runnable as-is before converting. Always test it with
python yourscript.pyfirst.
Where your .exe will be saved. Defaults to dist/ next to your script.
Click Browse to pick a different folder.
Click Browse → select a .ico file to embed as the executable's icon.
The icon appears in Windows Explorer, on the taskbar, and in the title bar when the exe runs.
Need to convert a PNG to ICO? Use convertico.com or install Pillow:
pip install pillow python -c "from PIL import Image; Image.open('icon.png').save('icon.ico')"
Two checkboxes control how the output is built:
| State | What Happens |
|---|---|
| Checked | Everything is packed into a single .exe file. Easy to share. Slightly slower to launch because it extracts itself each run. |
| Unchecked | Output is a folder containing the .exe plus all dependencies side-by-side. Faster to launch. Easier to update individual files. |
Recommendation: Use One-File for simple tools you want to share. Use One-Folder for large apps or when startup speed matters.
| State | What Happens |
|---|---|
| Unchecked | A black console/terminal window appears when the exe runs. Good for scripts, CLI tools, and debugging. |
| Checked | No terminal window — the exe launches silently. Required for GUI apps (tkinter, PyQt, etc.) that should look like normal Windows apps. |
Warning: If you use Windowed mode and your script has a bug, you will see nothing when it crashes — no error message, nothing. Always confirm your script works correctly in Console mode first, then switch to Windowed.
If your Python script reads external files at runtime — config files, databases, images, text files, CSV data — those files must be bundled into the build. Otherwise the exe will crash with a FileNotFoundError.
Click + Add → select one or more files → they appear in the list.
Click a file in the list to select it → click - Remove.
When running as a normal .py, files are next to your script. When running as a frozen .exe, bundled files are extracted to a temporary folder. You need to handle both cases in your code:
import sys
import os
def resource_path(relative_name):
"""Get the absolute path to a bundled resource file."""
if getattr(sys, 'frozen', False):
# Running as .exe — files are in sys._MEIPASS
base = sys._MEIPASS
else:
# Running as .py — files are next to the script
base = os.path.dirname(os.path.abspath(__file__))
return os.path.join(base, relative_name)
# Usage:
config_path = resource_path("config.json")
image_path = resource_path("logo.png")
db_path = resource_path("data.db")Add this function to any script that reads external files before converting it.
This section shows which python.exe PyToExe has detected on your system.
C:\Python311\python.exe [ Change ]
- Green text = Python found and verified ✓
- Red text = Python not found — you must fix this before building
When PyToExe is run as a plain .py file, Python is obvious. But if someone has packaged PyToExe itself into an .exe, the app can no longer assume sys.executable is Python — it might point to itself. Section 04 shows you exactly which Python will be used so there are no surprises.
Click Change to manually browse to a python.exe. This is useful when:
- You have multiple Python versions installed and want to use a specific one
- You are using a virtual environment's Python
- Auto-detection found the wrong Python
The big green button in the middle of the app. Press it to start the build.
States:
| Button State | Meaning |
|---|---|
| Green — "CONVERT .py --> .exe" | Ready to build |
| Grey — "Building ... please wait" | Build in progress, disabled |
| Returns to green | Build finished (success or failure) |
After a successful build, a green "Open Output Folder" button appears below the CONVERT button. Click it to jump straight to your .exe in Windows Explorer.
Section 05 shows live output from PyInstaller while your script is being compiled.
| Colour | What It Means |
|---|---|
| Yellow | Timestamp headers — marks start/end of build |
| Cyan/Blue | The exact PyInstaller command being run |
| Grey | Path info (Python, script, output folder) |
| White | Normal PyInstaller progress output |
| Green | Success — build completed, exe confirmed on disk |
| Orange | Warning — build finished but something needs attention |
| Red | Error — build failed, read this carefully |
[ 14:32:01 ] Build started ← yellow: started
Python : C:\Python311\python.exe ← grey: which python
Script : C:\projects\myapp.py ← grey: your script
Output dir : C:\projects\dist ← grey: where exe goes
Command: ← cyan: exact command
C:\Python311\python.exe -m PyInstaller --onefile ...
INFO: PyInstaller: 6.3.0 ← white: normal output
INFO: Python: 3.11.4
INFO: Analyzing myapp.py
INFO: Processing module hooks
INFO: Building PKG
INFO: Building EXE
[ 14:32:18 ] Build succeeded ← green: done!
Executable : C:\projects\dist\myapp.exe
If you see red text, scroll up to find the first red line — that is usually the root cause of the failure.
Click "Clear Log" (next to the progress bar) to wipe the log and start fresh. Useful before rebuilding.
When the build succeeds:
- The status bar turns green:
Done. myapp.exe --> C:\projects\dist - A popup confirms the exe was created and shows its location
- The "Open Output Folder" button appears — click it to open the folder in Explorer
- Your
.exeis at:[output folder]\[scriptname].exe
- Double-click it to run
- For best testing, copy the
.exeto a different machine (or a folder with no Python) and run it there — this confirms it is truly standalone
You can send your .exe to anyone running Windows. They do not need Python installed. Just share the file directly — via USB, email, cloud drive, etc.
The fastest path from script to exe:
Step 1 — Launch the app:
python py2exe_converter.pyStep 2 — Press any key on the splash screen.
Step 3 — In Section 01, click Browse next to "Python Script *" and select your .py file.
Step 4 — Leave all other settings at their defaults (One-File checked, Windowed unchecked).
Step 5 — Check Section 04 — confirm it shows a green Python path.
Step 6 — Click CONVERT .py --> .exe.
Step 7 — Watch the Build Log. Wait for the green success message (10–90 seconds depending on your script).
Step 8 — Click "Open Output Folder" and find your .exe.
Done. Your script is now a standalone executable.
- Select your
.pyscript in Section 01 - In Section 02, check "Windowed"
- Optionally add an icon in Section 01
- Press CONVERT
- The resulting
.exewill open with no black console window
Suppose your script reads config.json and logo.png:
- Add these lines to your script:
import sys, os def res(name): base = sys._MEIPASS if getattr(sys,'frozen',False) else os.path.dirname(__file__) return os.path.join(base, name) # Then use: open(res("config.json")) and res("logo.png")
- In Section 03, click + Add and select
config.jsonandlogo.png - Press CONVERT — both files will be bundled inside the exe
- Prepare a
.icofile (at least 256×256 pixels recommended) - In Section 01, click Browse next to "Icon (.ico)"
- Select your
.icofile - Press CONVERT — the icon is embedded in the exe
- In Section 01, click Browse next to "Output Folder"
- Select any folder on your system (e.g.
C:\Releases\v1.0\) - The exe will be saved there
If your script uses packages installed in a venv:
- In Section 04, click Change
- Browse to:
C:\your-project\venv\Scripts\python.exe - Press CONVERT — PyInstaller will use that venv's packages
Your script uses a package that PyInstaller couldn't auto-detect.
Fix:
pip install xyzMake sure the package is installed for the Python shown in Section 04. Then rebuild.
If it still fails, add this line anywhere in your script:
import xyz # noqa — tell PyInstaller this import existsYour script tries to read a file that wasn't bundled.
Fix: Add the file using Section 03, and update your code to use sys._MEIPASS (see Section 6 above).
This happens in Windowed mode — the error appears but the window closes too fast to see it.
Fix: Build in Console mode (uncheck Windowed). Run the exe in a terminal:
cd C:\your\dist\folder
myapp.exeYou'll see the full error message. Fix it, then switch back to Windowed.
Fix:
- Open Windows Security
- Go to Virus & threat protection → Manage settings
- Scroll to Exclusions → Add or remove exclusions
- Add your output folder
- Rebuild
Happens with PyQt5, PyQt6, or PySide apps.
Fix: Make sure you are using One-Folder mode (not One-File). Qt apps frequently need their platform plugins in the folder structure.
Large scripts with many dependencies (scientific computing, ML frameworks) can take 5–10 minutes. The Build Log will still be updating — don't close the app.
Usually means the Python interpreter in Section 04 is wrong or missing.
Fix: Click Change in Section 04 and manually point to a working python.exe. Then confirm PyInstaller is installed for that Python:
C:\path\to\python.exe -m pip install pyinstallerAlways test your script before converting.
Run python yourscript.py first. If it has any errors or crashes as a .py, the .exe will have the same problems.
Use Console mode for debugging. Always build with Console mode first. Once it works, switch to Windowed. This saves hours of confusion.
Keep your script in its own folder.
Put your .py and all its related data files in a dedicated folder. This keeps the dist/ output clean and makes Section 03 bundling straightforward.
Use a virtual environment for clean builds. Activate your venv before building, or point Section 04 to the venv's Python. This keeps the exe small by only including the packages your script actually needs.
One-Folder is easier to debug. If something goes wrong, One-Folder mode lets you inspect exactly what was bundled and what is missing. Switch to One-File once everything works.
The first red line in the log is the root cause. When a build fails, scroll up to the first red line in the Build Log. Everything below it is usually a cascade effect. Fix the first error and rebuild.
Antivirus exclusions are normal.
Adding your dist/ folder to antivirus exclusions is standard practice for PyInstaller builds. It is not a security risk — you are excluding a folder you fully control.