Install mforth¶
Goal: install mforth and verify the
mforthcommand works.Prerequisites: Python 3.11 or newer, and
pip.
Steps¶
-
Install from PyPI.
Or, to keep it isolated in a virtual environment (recommended if you're going to work on multiple Python projects):
-
Verify the install.
Should print
mforth 0.1.0(or whatever the current version is) and exit zero. -
(Optional) Confirm the full toolchain works.
Should list at least the
repl,run,compile,lsp, andversionsubcommands.
Install from source (for contributors)¶
If you want to hack on mforth itself rather than use it as a tool, install from a git checkout in editable mode:
git clone https://github.com/fkberthold/mforth
cd mforth
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
The .[dev] extra pulls in pytest and pytest-cov for the test
suite. Verify:
Troubleshooting¶
mforth: command not foundafterpip install. Confirm Python's user-script directory is on your$PATH. On most systems,pip install --user mforthputs the script at~/.local/bin/mforth. Add~/.local/binto$PATHif it isn't already (or use a virtual environment, which puts the script on the venv'sPATHautomatically when activated).ERROR: Package 'mforth' requires a different Python: ...— mforth needs Python 3.11 or newer. Checkpython --version; if older, install a newer Python and retry. Most distributions ship multiple versions side-by-side (python3.11,python3.12, etc).mforth lspdoesn't talk to Helix/Neovim. The install step is fine; the editor wiring is separate. See Use with Helix or Use with Neovim.
What to read next¶
- Tutorial: Getting started — your first guided run-through after install.
- Reference — the catalogue of every mforth surface.