|
15 | 15 | - Optionally, use `--depth=1` to make a shallow clone of the submodules.
|
16 | 16 | - While this is running, you can already setup the Python venv and dependencies in the next step.
|
17 | 17 |
|
18 |
| -### Setup your Python VirtualEnvironment and Dependencies |
| 18 | +### Set up the Python environment |
19 | 19 |
|
20 |
| -```shell |
21 |
| -python3 -m venv mlir_venv |
22 |
| -source mlir_venv/bin/activate |
23 |
| -# Some older pip installs may not be able to handle the recent PyTorch deps |
24 |
| -python -m pip install --upgrade pip |
25 |
| -# Install latest PyTorch nightlies and build requirements. |
26 |
| -python -m pip install -r requirements.txt |
27 |
| -python -m pip install -r torchvision-requirements.txt |
28 |
| -``` |
| 20 | +1. Install Python development libraries and headers |
29 | 21 |
|
30 |
| -Also, ensure that you have the appropriate `python-dev` package installed |
31 |
| -to access the Python development libraries / headers. For example, you can install |
32 |
| -it with the following `apt` command on Ubuntu/Debian. |
| 22 | + - For Ubuntu or Debian, run: |
| 23 | + |
| 24 | + ```shell |
| 25 | + sudo apt install python3-dev |
| 26 | + ``` |
| 27 | + |
| 28 | + - For other operating systems, [download Python](https://www.python.org/downloads) |
| 29 | + |
| 30 | +1. Create and Activate Python VirtualEnvironment + MLIR variant |
| 31 | + |
| 32 | + ```shell |
| 33 | + python3 -m venv mlir_venv |
| 34 | + source mlir_venv/bin/activate |
| 35 | + ``` |
| 36 | + |
| 37 | +1. Get the latest version of pip |
| 38 | + |
| 39 | + ```shell |
| 40 | + python -m pip install --upgrade pip |
| 41 | + ``` |
| 42 | + |
| 43 | + NOTE: Some older pip installs may not be able to handle the recent PyTorch deps |
| 44 | +1. Install the latest requirements. |
| 45 | + |
| 46 | + ```shell |
| 47 | + python -m pip install -r requirements.txt -r torchvision-requirements.txt |
| 48 | + ``` |
33 | 49 |
|
34 |
| -```shell |
35 |
| -sudo apt install python3-dev |
36 |
| -``` |
37 | 50 |
|
38 | 51 | ### (Optional) Set up pre-commit
|
39 | 52 |
|
|
0 commit comments