Install without Python experience¶
You may not need to install anything at all
If you just want to look up pronunciations occasionally, the free online tool at rianthai.pro/thai-transliteration runs thaiphon in your browser — no Python, no terminal, no setup. Paste Thai text and get all three transcription schemes instantly.
This install guide is for people who need more than the online tool offers: batch processing of many words, integration into a custom app, or offline use without an internet connection.
This guide walks you through getting thaiphon working on your computer from scratch. It assumes you have never installed Python before and have never used a terminal. You will need about fifteen minutes.
Already comfortable with pip?
If you know Python and pip, go to the standard install guide instead.
Step 1 — Install Python¶
thaiphon requires Python 3.10 or newer.
- Open a web browser and go to python.org/downloads.
- Click the large yellow Download Python 3.x.x button. The site detects your operating system automatically.
- Run the installer you downloaded.
On Windows — critical step: At the first screen of the installer, check the box that says "Add Python to PATH" before clicking Install Now. If you miss this, Python will install but the terminal will not find it.
On macOS: Run the downloaded .pkg file and follow the prompts. If your Mac asks whether to allow the installation, click Allow.
On Linux: Python 3 is likely already installed. Open a terminal and type python3 --version. If you see a version number 3.10 or higher, skip to Step 2.
Step 2 — Open a terminal¶
A terminal (also called a command prompt or command line) is a text window where you type instructions.
Press the Windows key, type cmd, and press Enter. A black window opens. This is your terminal.
Alternatively: press Windows key + R, type cmd, press Enter.
Press Command + Space, type Terminal, press Enter.
Or: open Finder → Applications → Utilities → Terminal.
You likely know how to do this already. Common shortcut: Ctrl + Alt + T.
Step 3 — Verify Python is installed¶
In the terminal, type the following and press Enter:
You should see something like Python 3.12.0. If you see an error, go back to Step 1 and make sure you checked "Add to PATH" on Windows, or repeat the macOS installer.
Step 4 — Install thaiphon and the lexicon package¶
In the same terminal window, type this and press Enter:
You will see lines of text as the packages download and install. Wait until you see lines that include Successfully installed thaiphon and Successfully installed thaiphon-data-volubilis.
Why two packages?
thaiphon is the engine. thaiphon-data-volubilis is a separate Thai lexicon derived from the VOLUBILIS Mundo Dictionary. Installing both raises accuracy from ~57% to ~75% on an independent Wiktionary benchmark. The engine detects the lexicon automatically — no extra steps needed.
If you see a "permission denied" error on macOS/Linux, try:
Step 5 — Test it works¶
Still in the terminal, start Python:
You will see three >>> symbols. This is the Python prompt. Type the following lines, pressing Enter after each one:
import thaiphon
print(thaiphon.transcribe("สวัสดี", format="html"))
print(thaiphon.transcribe("ข้าวผัด", scheme="ipa"))
You should see something like:
If the lexicon package is installed correctly, compound words like ข้าวผัด (fried rice) will be segmented and transcribed accurately.
Type exit() and press Enter to leave Python.
Step 6 — Create a script file¶
Typing into the Python prompt works for quick tests, but for regular use it's better to write a script file.
- Open Notepad (Windows) or TextEdit (macOS) or any plain-text editor.
- Copy and paste the following:
from thaiphon import transcribe
# List of Thai words to transcribe.
words = ["สวัสดี", "น้ำ", "ข้าว", "รัก", "ปลา"]
for word in words:
result = transcribe(word, scheme="ipa")
print(f"{word} → {result}")
-
Save the file as
my_transcriber.pyon your Desktop or in a folder you can find easily. Make sure the file name ends with.pyand the encoding is UTF-8 (in Notepad, choose "UTF-8" from the Encoding dropdown when saving). -
In the terminal, navigate to where you saved the file. On Windows:
On macOS: -
Run the script: === "Windows"
=== "macOS / Linux"
Expected output:
Common problems¶
The terminal shows "Thai characters" as boxes or question marks.
Your terminal may not support Thai script display. This does not mean thaiphon is broken — the transcription is calculated correctly. You can write the output to a text file instead:
Then open output.txt in a text editor that supports Unicode (most modern editors do).
Pasting Thai text loses the tone marks.
Some applications change the encoding when copying and pasting. Use a Unicode-aware editor (VS Code, Notepad++, BBEdit) and make sure the file is saved as UTF-8.
I see ModuleNotFoundError: No module named 'thaiphon'.
Python found but thaiphon is not installed in that Python's environment. Check which Python you used to install (pip --version shows the associated Python) and which one you used to run the script. On some systems multiple Python versions coexist. Try pip3 install thaiphon or python3 -m pip install thaiphon.
I see SyntaxError on the first line.
This usually means you are running Python 2 instead of Python 3. Check your version with python --version. thaiphon requires 3.10 or newer.
Next steps¶
- Your first transcription — more examples and explanation of the output.
- Reading profiles — choosing everyday vs. formal pronunciation.
- Troubleshooting — more help for common problems.