Installing Harlequin

Installing Harlequin

Harlequin is a Python program, and there are many ways to install and run it. We strongly recommend using uv:

  1. Install uv. From a POSIX shell, run:

    $ curl -LsSf https://astral.sh/uv/install.sh | sh

    Or using Windows Powershell:

    powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
  2. Install Harlequin as a tool using uv:

    $ uv tool install harlequin

    This command will install Harlequin into an isolated environment and add it to your PATH so you can easily run the executable.

Other Installation Methods

Alternatively, if you know what you’re doing, after installing Python 3.9 or above, install Harlequin using pip, pipx, poetry, or any other program that can install Python packages from PyPI:

$ pip install harlequin

There is also a Homebrew formula for Harlequin, although this is maintained by the community and is not as rigorously tested as the Python installations. Note that the formula includes several Harlequin adapter packages (Postgres, MySQL, and ODBC) and their dependencies, which is convenient but increases the application size.

$ brew install harlequin

Installing Database Adapters

Harlequin can connect to dozens of databases using adapter plug-ins. Adapters are distributed as their own Python packages that need to be installed into the same environment as Harlequin.

For a list of known adapters provided either by the Harlequin maintainers or the broader community, see the adapters page.

The adapter docs also include installation instructions. Some adapters can be installed as Harlequin extras, like postgres. If you used uv to install Harlequin:

$ uv tool install 'harlequin[postgres]'

You can install multiple extras:

$ uv tool install 'harlequin[postgres,mysql,s3]'
lightbulb icon Tip
Depending on your shell, you may or may not need to place single or double quotes around the package name with extras:
% uv tool install 'harlequin[postgres,mysql,s3]'

Some adapters are not available as extras, and have to be installed manually. You may also wish to do this to control the version of the adapter that Harlequin uses. You can add adapters to your installation using uv’s --with option:

$ uv tool install harlequin --with harlequin-odbc