Skip to main content

Installing mxpy

This page describes how to install mxpy (the CLI tool). The recommended way to install mxpy is by using pipx. If you want to learn more about pipx you can check out this page.

note

If you'd like to use mxpy on Windows, we recommend installing it within the Windows Subsystem for Linux (WSL). If you experience an issue, please follow the troubleshooter.

Prerequisites

Before installing mxpy, please make sure you have a working Python 3 environment. You'll need Python 3.8 or later on Linux or MacOS.

Install using pipx

You'll need pipx installed on your machine. For more details on how to install pipx check out this page.

note

If you've previously installed mxpy using mxpy-up, we advise you to switch to pipx, but make sure to remove the old mxpy shortcut and virtual Python environment beforehand:

rm ~/multiversx-sdk/mxpy
rm -rf ~/multiversx-sdk/mxpy-venv

In order to install mxpy using pipx, run the following command:

pipx install multiversx-sdk-cli --force

This will simply install the latest version available.

In case you want to install a specific version you should also specify the version.

pipx install multiversx-sdk-cli==9.5.1

You can also install mxpy directly from a GitHub branch. Replace branch_name with your desired branch and run the following command:

pipx install git+https://github.com/multiversx/mx-sdk-py-cli@branch_name

To check that mxpy installed successfully you can run the following command:

mxpy --version

As of version v9.7.0, mxpy includes support for shell completion on both Linux and macOS. To get started, first ensure that pip is installed by running the following command:

pip3 --version

If pip is not installed, we can install it on Linux with:

sudo apt install python3-pip

For macOS users, install pip by executing:

python3 -m ensurepip

Once pip is installed, proceed by installing the required package with:

pip3 install argcomplete

Finally, activate shell completion with this command:

activate-global-python-argcomplete

Upgrade mxpy using pipx

To upgrade mxpy to a newer version, you can simply run the following command:

pipx upgrade multiversx-sdk-cli