Get Drafter running
Goal
You want Drafter installed on your computer and proof that it works, so you can start building.
Before you start
You need Python 3.10 or newer installed, and an editor you can run Python files from. The steps below cover Thonny (common in introductory courses) and the command line. Any editor works: Drafter is an ordinary Python package, so install it however you normally install packages.
Install
Thonny has a built-in package manager:
- Open Tools, then Manage packages.
- Type
drafterin the search bar and press Find packages from PyPI. - Select drafter in the results and press Install.
Note
If the package manager is unavailable, open Tools, then Open system shell, and type:
pip install drafter
If you aren't using Thonny, then in a terminal (Command Prompt, PowerShell, or a shell):
pip install drafter
If you use virtual environments, activate yours first and install into it.
Verify it worked
Create a new Python file, put this single line in it, and run it:
from drafter import *
If it runs without an error, Drafter is installed. Nothing visible happens yet, and that is expected. You will build your first page in the next step.
Common problems
No module named 'drafter': the install went to a different Python than the one running your file. In Thonny, install through Tools → Manage packages so the right Python is used. On the command line, trypython -m pip install drafterso pip and Python match.pipis not recognized: usepython -m pip install drafterinstead, or on some systemspy -m pip install drafter.- Permission errors on shared or lab machines: try
pip install --user drafter, or ask your instructor how packages are managed on lab computers. - It installed, but an old version: upgrade with
pip install --upgrade drafter.
Still stuck? See Troubleshooting.
-
Next: Build your first app
Build a working counter site, one idea at a time, in about twenty minutes.