This guide explains how to build the Edge TTS Converter application from the provided source files on macOS and Windows.
Before you begin, ensure you have the following installed on your system:
- Python: Version 3.8 or newer is recommended.
- You can download Python from python.org.
- During installation on Windows, make sure to check the box that says "Add Python to PATH".
- pip: Python's package installer. It usually comes with Python.
- PyInstaller: The tool used to bundle the application.
- (Optional but Recommended) A Virtual Environment Tool: Like
venv(built-in) orcondaif you prefer. While not strictly required by these instructions for a one-off build, it's good practice for managing Python projects and their dependencies.
-
Download and Unzip:
- Download the provided
.zipfile (e.g.,FastestTTS_App.zip). - Extract/unzip its contents to a folder on your computer. This folder will be referred to as your "project folder" (e.g.,
FastestTTS_App).
- Download the provided
-
Open Terminal / Command Prompt:
- macOS: Open Terminal (you can find it in Applications > Utilities).
- Windows: Open Command Prompt or PowerShell (search for them in the Start Menu).
-
Navigate to Project Folder:
- In your Terminal or Command Prompt, use the
cd(change directory) command to go into the project folder you just unzipped.- Example:
cd path/to/your/FastestTTS_App - (You can often drag the folder icon from your file explorer into the terminal window after typing
cdto get the correct path).
- Example:
- In your Terminal or Command Prompt, use the
If you don't have PyInstaller installed in the Python environment you intend to use, install it from your terminal (while inside the project folder, or globally if you prefer, though project-specific is better):
- For most systems (using pip with your default Python):
python -m pip install pyinstaller
- On macOS, if
pythondefaults to an older Python 2, you might needpython3:python3 -m pip install pyinstaller
- If using a Conda environment, and it's active:
or
conda install pyinstaller
python -m pip install pyinstaller
The process is similar for both macOS and Windows once the prerequisites are met and you are in the project folder in your terminal.
Crucial First Step: Install edge_tts
Before running PyInstaller, it's vital to ensure the edge_tts library and its dependencies are installed in the Python environment that PyInstaller will use.
- Ensure you are in the project folder in your Terminal/Command Prompt.
- Install
edge_tts:- For most systems:
python -m pip install edge_tts
- On macOS (if
pythonis Python 2, or to be specific):python3 -m pip install edge_tts
edge_ttsinto the Python environment that yourpython(orpython3) command points to. - For most systems:
Now, run the PyInstaller build command:
- For most systems (including Anaconda environments where
pythonpoints to the environment's Python):python -m PyInstaller EdgeTTSConverter.spec
- On macOS, if you specifically need to use
python3:python3 -m PyInstaller EdgeTTSConverter.spec
This command tells PyInstaller to use the EdgeTTSConverter.spec file (which is included in the zip) to build the application. PyInstaller will create two new folders: build and dist.
-
On macOS:
- After the build completes, navigate to the
distfolder inside your project folder. - Inside
dist, you will find a folder namedEdgeTTSConverter. - Inside that folder, you'll find
EdgeTTSConverter.app. This is your application. Double-click it to run.
- After the build completes, navigate to the
-
On Windows:
- After the build completes, navigate to the
distfolder inside your project folder. - Inside
dist, you will find a folder namedEdgeTTSConverter. - Inside that folder, you'll find
EdgeTTSConverter.exe. This is your application. Double-click it to run. - Important: All the other files and folders within
dist/EdgeTTSConverter/are necessary for the.exeto work. Keep them together.
- After the build completes, navigate to the
This is the most common issue and usually means PyInstaller couldn't find the edge_tts library when the bundled application starts, even if it was installed on your system.
Solution Steps:
- Close the application if it's (partially) running or showing the error.
- Open your Terminal or Command Prompt and use
cdto navigate into your project folder (e.g.,FastestTTS_App). - Uninstall
edge_tts(to ensure a clean state for the correct environment):- Run:
python -m pip uninstall edge_tts(orpython3 -m pip uninstall edge_ttson Mac if needed). Confirm with 'y' if prompted.
- Run:
- Reinstall
edge_ttsDIRECTLY in the context of your project folder's Python environment:- Crucially, ensure you are still in your project folder in the terminal.
- Run:
python -m pip install edge_tts(orpython3 -m pip install edge_ttson Mac if needed). - This step is vital to ensure
edge_ttsis installed in the Python environment that PyInstaller will use for the build.
- Clean previous build attempts:
- In your project folder, delete the
buildfolder and thedistfolder entirely. This prevents old files from interfering.
- In your project folder, delete the
- Re-run the PyInstaller build command:
python -m PyInstaller EdgeTTSConverter.spec(orpython3 -m PyInstaller EdgeTTSConverter.specon Mac).
- Test the application again from the newly created
distfolder.
Other Troubleshooting Tips:
- Python Environment Consistency: If you have multiple Python installations (e.g., system Python, Homebrew Python, Anaconda), ensure that the
pythoncommand in your terminal (the one you use forpip installandPyInstaller) is the same Python environment whereedge_ttsandPyInstallerare installed and where your script runs correctly during development.- You can check your Python version and path with
python --versionandpython -c "import sys; print(sys.executable)".
- You can check your Python version and path with
- Check PyInstaller Output: When PyInstaller runs, it prints a lot of information. Look for any "WARNING" messages in the output, as they might give clues about missing modules or other issues.
- Antivirus Software (Windows): Sometimes, antivirus software can interfere with PyInstaller or falsely flag the created
.exe. Try temporarily disabling your antivirus if you suspect this (do so at your own risk and only if you trust the source code).
Good luck with building and running the application!