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

info

Keep in mind that installing using pipx is only available for mxpy v9.2.0 or later.

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 and you'd like to switch to pipx, 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

Upgrade mxpy using pipx

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

pipx upgrade multiversx-sdk-cli

Install using mxpy-up

Installing mxpy using mxpy-up is not recommended anymore. We recommend using pipx instead.

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

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

Additionally, you might want to cleanup the shell profile files, to not alter anymore the PATH variable with respect to ~/multiversx-sdk: ~/.profile, ~/.bashrc and / or ~/.zshrc.