You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/sdk-and-tools/sdk-py/installing-mxpy.md
+12-86Lines changed: 12 additions & 86 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ title: Installing mxpy
7
7
8
8
How to install mxpy
9
9
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.
11
11
12
12
**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.
13
13
@@ -19,110 +19,36 @@ Before installing **mxpy**, please make sure you have a working **Python 3** env
19
19
20
20
-**3.8** or later on Linux and MacOS
21
21
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
-
36
22
[comment]: #(mx-context-auto)
37
23
38
-
## **Install using mxpy-up (recommended)**
24
+
## **Install using mxpy-up**
39
25
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:
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`.
65
34
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).
72
36
73
37
[comment]: #(mx-context-auto)
74
38
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
78
40
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).
80
42
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:
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:
0 commit comments