Skip to content

Commit caaeb21

Browse files
[docs] Restructure "Set up the Python environment" section in development.md (#4053)
Co-authored-by: Scott Todd <[email protected]>
1 parent 445c845 commit caaeb21

File tree

1 file changed

+29
-16
lines changed

1 file changed

+29
-16
lines changed

docs/development.md

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,38 @@
1515
- Optionally, use `--depth=1` to make a shallow clone of the submodules.
1616
- While this is running, you can already setup the Python venv and dependencies in the next step.
1717

18-
### Setup your Python VirtualEnvironment and Dependencies
18+
### Set up the Python environment
1919

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
2921

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+
```
3349

34-
```shell
35-
sudo apt install python3-dev
36-
```
3750

3851
### (Optional) Set up pre-commit
3952

0 commit comments

Comments
 (0)