Skip to content

Commit 79e18d9

Browse files
Merge pull request #768 from multiversx/simplify-mxpy-install-docs
Update mxpy installation page
2 parents 93a949d + 8c4e5f4 commit 79e18d9

File tree

1 file changed

+12
-86
lines changed

1 file changed

+12
-86
lines changed

docs/sdk-and-tools/sdk-py/installing-mxpy.md

Lines changed: 12 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: Installing mxpy
77

88
How to install mxpy
99

10-
This page describes how to install **mxpy** (the CLI tool). The recommended way to install **mxpy** is by using the `mxpy-up` facility.
10+
This page describes how to install **mxpy** (the CLI tool). The recommended way to install **mxpy** is by using the `mxpy-up` script.
1111

1212
**mxpy** is currently supported on Linux and MacOS. Some of its features might work on Windows as well, although using **mxpy** on Windows is neither recommended, nor supported at this time.
1313

@@ -19,110 +19,36 @@ Before installing **mxpy**, please make sure you have a working **Python 3** env
1919

2020
- **3.8** or later on Linux and MacOS
2121

22-
Smart contracts written in C require the ncurses library routines for compiling. Install them using the following:
23-
24-
For Linux:
25-
26-
```
27-
sudo apt install libncurses5
28-
```
29-
30-
For MacOS:
31-
32-
```
33-
brew install ncurses
34-
```
35-
3622
[comment]: # (mx-context-auto)
3723

38-
## **Install using mxpy-up (recommended)**
24+
## **Install using mxpy-up**
3925

40-
In order to install **mxpy** using the `mxpy-up` installation script, run the following commands in a terminal:
26+
In order to install **mxpy** using the `mxpy-up` script, run the following commands:
4127

4228
```
4329
wget -O mxpy-up.py https://raw.githubusercontent.com/multiversx/mx-sdk-py-cli/main/mxpy-up.py
4430
python3 mxpy-up.py
4531
```
4632

47-
This will create a light Python virtual environment (based on `venv`) in `~/multiversx-sdk/mxpy-venv `. Since `mxpy v6.0.0` we do not alter the **`$PATH`** variable.
48-
You'll need to manually include `~/multiversx-sdk` in your **`$PATH`** variable (by editing the appropriate `.profile` file) as done bellow:
49-
```
50-
export PATH="$HOME/multiversx-sdk:$PATH"
51-
```
52-
53-
[comment]: # (mx-context-auto)
54-
55-
### **Troubleshooting and other notes**
56-
57-
On Ubuntu 20.04, if you receive the error: `invalid command 'bdist_wheel'` - run the following command, then retry mxpy-up:
58-
59-
```
60-
pip3 install wheel
61-
python3 mxpy-up.py
62-
```
63-
64-
On MacOS, you can switch to Python 3.8 as follows:
33+
Running the above will create a Python virtual environment in `~/multiversx-sdk/mxpy-venv`, it will install the package [`multiversx-sdk-cli`](https://pypi.org/project/multiversx-sdk-cli) into this environment, and it will create the shortcut `~/multiversx-sdk/mxpy`.
6534

66-
```
67-
brew info python@3.8
68-
brew unlink python
69-
brew link --force python@3.8
70-
python3 --version
71-
```
35+
The `mxpy` shortcut is not automatically added to your **`$PATH`** environment variable, so **you'll need to configure that manually** (see below).
7236

7337
[comment]: # (mx-context-auto)
7438

75-
## **Install without mxpy-up**
76-
77-
If you'd like to install without relying on the easy installation script, please read this section. Otherwise, feel free to skip it.
39+
## Make mxpy available in your shell
7840

79-
Make sure you also have **pip3** installed.
41+
In order to have the **mxpy** shortcut available in the shell after installation, you'll need to manually include `~/multiversx-sdk` in your **`$PATH`** environment variable by editing the appropriate shell profile file: `~/.bashrc` (for Bash) or `~/.zshrc` (for Zsh).
8042

81-
[comment]: # (mx-context-auto)
82-
83-
### **Prepare PATH**
84-
85-
In order to have the command **mxpy** available in your shell after install, make sure you adjust the `PATH` environment variable as described below:
86-
87-
On Linux in `~/.profile`:
88-
89-
```
90-
export PATH="$HOME/.local/bin:$PATH"
91-
```
92-
93-
On MacOS in `~/.bash_profile` or `~/.zshrc` if you’re using `zsh`:
94-
95-
```
96-
export PATH=$HOME/Library/Python/3.8/bin:${PATH}
97-
```
98-
99-
:::note add the right version
100-
In the snippet above, replace `3.8` with your actual `MAJOR.MINOR` version of Python. This can be found by running:
43+
For example:
10144

10245
```
103-
python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')"
46+
echo "export PATH="\$HOME/multiversx-sdk:\$PATH"" >> ~/.bashrc
47+
echo "export PATH="\$HOME/multiversx-sdk:\$PATH"" >> ~/.zshrc
10448
```
10549

106-
:::
107-
108-
You may need to restart your user session for these changes to take effect.
109-
110-
[comment]: # (mx-context-auto)
111-
112-
### **Install and smoke test**
113-
114-
In order to install **mxpy**, issue the following command:
115-
116-
```
117-
pip3 install --user --upgrade --no-cache-dir multiversx-sdk-cli
118-
```
119-
120-
[comment]: # (mx-context-auto)
121-
122-
### **Troubleshooting**
123-
124-
If you encounter encoding-related issues at installation time, such as: `UnicodeDecodeError: 'ascii' codec can't decode byte`, then please set `PYTHONIOENCODING` before running the installation command:
50+
Then, open a new shell and run the following to verify that **mxpy** is installed correctly:
12551

12652
```
127-
PYTHONIOENCODING=utf8 pip3 install --user --upgrade --no-cache-dir mxpy
53+
mxpy --version
12854
```

0 commit comments

Comments
 (0)