Skip to content

Installing ehrQL

In this section, you will install ehrQL.

Prerequisites🔗

You should install Docker and the OpenSAFELY CLI before you install ehrQL. You should install VS Code, a code editor, to complete the tutorial.

Open the terminal🔗

VS Code includes a terminal. There are several ways to open it. We will do so from the menu, using Terminal > New Terminal or View > Terminal.

A screenshot of VS Code, showing the terminal

Upgrade the OpenSAFELY CLI🔗

If you previously installed the OpenSAFELY CLI, then upgrade it to the latest version. In the terminal, type

opensafely upgrade

and press Enter.

A screenshot of VS Code, showing the terminal after the opensafely upgrade command was run

Install ehrQL🔗

In the terminal, type

opensafely pull ehrql

and press Enter.

A screenshot of VS Code, showing the terminal after the opensafely pull command was run

Check ehrQL was installed correctly🔗

In the terminal, type:

opensafely exec ehrql:v0 --version

And press Enter.

A screenshot of VS Code, showing the terminal after the opensafely exec command was run