Skip to content

Set up developer environment

Peter Jonas edited this page Feb 15, 2026 · 17 revisions

Summary

  1. Running the commands in this guide
  2. Supported architectures
  3. Install a package manager
  4. Install CMake and Git
  5. Advanced developer environment (optional)
    1. All platforms
    2. Advanced Linux environment
    3. Advanced macOS environment
    4. Advanced Windows environment

Running the commands in this guide

Linux and macOS

Any shell in any terminal should work, but we suggest everyone uses Bash version 5+ simply for consistency.

Tip

On macOS, use the default shell (Zsh) to install a package manager, which you can then use to install Bash v5.

Windows

Use PowerShell in Windows Terminal. CMD (Command Prompt) might work but it uses a different syntax.

Tip

Once you've installed Git, consider using Git Bash instead of PowerShell.

Note

You probably don't want to use WSL or WSL2 (Windows Subsystem for Linux). Compiling in those environments would create Linux binaries rather than Windows executables.

Supported architectures

  • Windows: x86_64
  • macOS: Apple Silicon (arm64), Intel (x86_64), Universal
  • Linux: x86_64, arm64

Other architectures may work if you can obtain suitable binaries of all dependencies, including Qt.

Install a package manager

A package manager enables you to install software quickly via the command line.

Linux

Congratulations, you already have a package manager! Use the following command to find out what it's called:

which apt yum dnf pacman emerge zypper | xargs -n1 basename

macOS

Please install one of these package managers:

Windows

Please install one of these package managers:

  • Chocolatey (choco) - recommended for most developers
  • Scoop (scoop) - use this if you lack administrator privileges (but you'll need an admin to install it for you)

If you picked Chocolatey, it's recommended that you enable Sudo for Windows so that you can use choco within non-Administrator prompts:

choco install [program]        # Error: Permission denied!
sudo choco install [program]   # Spawns UAC dialog to request permission.
Alternative to sudo: gsudo

The third-party utility gsudo does the same thing as Sudo for Windows and offers more advanced features besides.

# Once from an Administrator prompt:
choco install gsudo

# In future, from non-Admin prompts:
gsudo choco install [program]  # Spawns UAC dialog to request permission.

If you picked Scoop, you can use it in non-Administrator prompts by default, but you might want to enable sudo or install gsudo anyway for use with other commands that require administrator privileges.

Install CMake and Git

Use the commands for your package manager.

Tip

You can skip installing CMake if you plan to use the version bundled with Qt in Qt/Tools/CMake. If so, add its binary directory to PATH after you Install Qt (this is done for you if you compile in Qt Creator). Either way, you still need to install Git.

macOS

brew install cmake git
sudo port install cmake git

Windows

# Chocolatey (Admin prompt or sudo required)
choco install cmake --installargs ADD_CMAKE_TO_PATH=System
choco install git

# Others
scoop install cmake git

Linux

sudo apt install cmake git
sudo dnf install cmake git
sudo pacman -S cmake git

Older distributions may not provide a recent enough version of CMake. Check near the top of MuseScore's CMakeLists.txt for the minimum required version, then run:

cmake --version

If your distribution's version of CMake is too old, try installing it via Python's package manager pip instead. Make sure you remove the distribution version first.

# Remove outdated distribution CMake
sudo apt remove --purge cmake
sudo dnf erase cmake

# Install pip for your distribution
sudo apt install python3-pip
sudo dnf install python3-pip

# Install latest CMake from pip
pip3 install wheel setuptools  # Need these first to install binary packages like CMake.
pip3 install cmake

The CMake PyPI package (the one installed via pip) is an official method of installing CMake as documented on the CMake downloads page. However, distribution maintainers may be forced to use their distribution's CMake when building a MuseScore package, so the existence of the PyPI CMake is not a valid reason to update our minimum required version prematurely (but there may be other reasons for doing so that are valid).

Advanced developer environment (optional)

This section is not required to compile and run MuseScore. However, it may be required to run certain scripts in the repository that are supplementary to the build, such as scripts to generate assets, templates, translations, or other resources. It will also give you a much nicer experience on the command line!

All platforms

Some programming languages have dedicated package managers that can be used to install software written in that language, such as libraries, modules, or applications, or command line utilities.

Programming language Package manager
Python (CPython) pip or pip3
JavaScript (Node / Bun) npm / bun

The same software might also be available via your regular package manager (apt, choco, brew, etc.), but it's often outdated or less well supported. Therefore, whenever there's a choice, you should always prefer to install software from a language-specific package manager rather than a generic package manager.

For example, when installing the Python Requests module:

# Don't do this:
sudo apt install python3-requests  # Installs outdated version of Requests.

# Do this instead:
sudo apt install python3-pip       # Install pip.
pip3 install requests              # Install latest version of Requests (notice no 'sudo').

Better still, use a tool like pipx or PDM to install modules into an isolated virtual environment away from other software.

Advanced Linux environment

Congratulations, you already have an advanced developer environment!

Advanced macOS environment

For licensing reasons, macOS only provides Bash version 3 by default. Version 3 is ancient, so use these commands to install a more recent version:

bash --version                        # Should see version 3 (probably v3.2.57 or similar)
brew install bash                     # Install newer Bash
bash --version                        # Should no longer be version 3 (probably v5 or higher)

# If you still see version 3, close and reopen Terminal, then try `bash --version` again before proceeding.

which bash | sudo tee -a /etc/shells  # Allow new Bash to run as a login shell in Terminal
chsh -s "$(which bash)"               # Optional: use it as your default login shell instead of Zsh
brew install bash-completion@2        # Optional: Install Bash tab completions for common commands (e.g. Git)

For tab completion to work, you must add the following to ~/.bash_profile:

eval "$(/usr/local/bin/brew shellenv)"                        # Intel-based Macs only
eval "$(/opt/homebrew/bin/brew shellenv)"                     # Apple Silicon Macs only
source "${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh"  # All Macs

When writing shell scripts for macOS, it's a good idea to check the Bash version before doing anything else.

#!/usr/bin/env bash

((${BASH_VERSION%%.*} >= 5)) || { echo >&2 "$0: Error: Please upgrade Bash."; exit 1; }

# Commands from this point onwards can safely use modern Bash syntax

When it comes to standard Unix utilities like ls, find, grep, sed, etc., macOS provides the BSD variants of these utilities rather than the more popular GNU variants found in Linux and in Git Bash on Windows. Syntax and features vary slightly between the BSD and GNU variants, so bear this in mind if you need to write shell scripts that are portable across platforms. It's possible to install the GNU variants on macOS, but it's probably best to avoid this otherwise you'll end up writing shell scripts that won't work properly without them.

Advanced Windows environment

Now that you've installed Git, you also have access to Git Bash. This is a full Bash shell plus a standard Unix utilities like ls, find, grep, sed, etc., all compiled to work natively on Windows. Unless stated otherwise, Git Bash can be used instead of PowerShell and CMD for all subsequent commands in this guide.

You can access Git Bash via the Start Menu and it will launch inside MinTTY. However, we recommend using it inside Windows Terminal instead. Windows Terminal is installed by default in Windows 11. Windows 10 users can install it for free from the Microsoft Store.

Launch Windows Terminal, open its Settings, and add a new profile with the following information:

  • Name: Bash
  • Starting directory: %USERPROFILE%

If you installed Git via Chocolatey or the EXE installer:

  • Command line: "%ProgramFiles%\Git\bin\bash.exe" -i
  • Icon: %ProgramFiles%\Git\mingw64\share\git\git-for-windows.ico

If you installed Git via Scoop:

  • Command line: "%UserProfile%\scoop\apps\git\current\usr\bin\bash.exe" -i
  • Icon: %UserProfile%\scoop\apps\git\current\mingw64\share\git\git-for-windows.ico

Bash will now appear in the dropdown list of profiles within Windows Terminal. You can optionally make it the default profile via Windows Terminal's Settings > Startup.

Add the following to ~/.bashrc to make the command line experience even more similar to other platforms:

# Open new Windows Terminal tabs in the same directory as the current tab.
# https://learn.microsoft.com/en-us/windows/terminal/tutorials/new-tab-same-directory#mingw
PROMPT_COMMAND=${PROMPT_COMMAND:+"$PROMPT_COMMAND; "}'printf "\e]9;9;%s\e\\" "`cygpath -w "$PWD" -C ANSI`"'

# Display current directory in the shell prompt and window title like on Ubuntu Linux.
PS1="\[\e]0;Bash: \w\a\]\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ "

if [[ -d "${HOME}/.local/bin" ]]; then
    export PATH="${HOME}/.local/bin:${PATH}"
fi

if [[ -d "${HOME}/bin" ]]; then
    export PATH="${HOME}/bin:${PATH}"
fi

export EDITOR="nano"  # Use Nano as the default editor for `git commit` and `git rebase -i`

# Force `ln` to create proper symlinks instead of copying files (requires permission)
export MSYS="winsymlinks:nativestrict"

# Python
export PYTHONUTF8=1 # https://peps.python.org/pep-0540/#proposal
export PYTHONIOENCODING="utf-8" # https://stackoverflow.com/a/12834315
unset PYTHONLEGACYWINDOWSFSENCODING

function killall()
{
    taskkill //F //IM "$1.exe" //T
}

# No man pages on Windows :( https://stackoverflow.com/a/77485966
function man()
(
    exec 2>&1
    for t in $(type -at "$1"); do
        case "${t}" in
        alias)
            alias "$1"
            ;;
        keyword)
            echo "$1 is a shell keyword"
            help -m "$1"  # Show Bash help.
            break
            ;;
        function)
            echo "function $(declare -f "$1")"
            ;;
        builtin)
            echo "$1 is a shell builtin"
            help -m "$1"  # Show Bash help.
            break
            ;;
        file|*)
            echo "$1 is $(which "$1")"
            command "$1" --help  # Show command's help.
            break
            ;;
        esac
        echo
    done | less
)

Tip

Use the cygpath command to convert file paths between Windows-style (C:\) and Unix-style (/c/) when you need to. Normally Git Bash does this automatically so you don't need to think about it, but sometimes you have to do it yourself, for example when using environment variables like ${LocalAppData} that were set by Windows.


Current Next
Top of page Install Qt and Qt Creator

Clone this wiki locally