Skip to content

Commit a31f56c

Browse files
authored
Update installation instructions in README.md and easy_install.md to include Git as a prerequisite (#234)
1 parent f951d10 commit a31f56c

File tree

2 files changed

+51
-43
lines changed

2 files changed

+51
-43
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ For more details, see our papers:
4545
Installing **DeePTB** is straightforward. We recommend using a virtual environment for dependency management.
4646

4747
- **Requirements**
48+
- Git
4849
- Python 3.9 to 3.12.
4950
- Torch 2.0.0 to 2.5.1 ([PyTorch Installation](https://pytorch.org/get-started/locally)).
5051
- ifermi (optional, for 3D fermi-surface plotting).

docs/quick_start/easy_install.md

+50-43
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,60 @@ This guide will help you install DeePTB, a Python package that utilizes deep lea
55
## Prerequisites
66

77
Before installing DeePTB, ensure you have the following prerequisites:
8+
- Git
9+
- Python 3.9 to 3.12.
10+
- Torch 2.0.0 to 2.5.1 ([PyTorch Installation](https://pytorch.org/get-started/locally)).
11+
- ifermi (optional, for 3D fermi-surface plotting).
12+
- TBPLaS (optional).
813

9-
- Python 3.8 or later.
10-
- PyTorch 1.13.0 or later.
11-
- Git (to clone the repository).
12-
13-
### Optional
14-
- ifermi (for 3D fermi-surface plotting).
15-
16-
## Virtual Environment (Recommended)
17-
18-
We recommend using a virtual environment to manage dependencies. Create one with the following command:
19-
20-
```bash
21-
python -m venv /path/to/new/virtual/environment
22-
```
23-
24-
Activate the virtual environment:
25-
26-
- On macOS and Linux:
27-
```bash
28-
source /path/to/new/virtual/environment/bin/activate
29-
```
30-
- On Windows:
31-
```bash
32-
\path\to\new\virtual\environment\Scripts\activate
33-
```
14+
## Installation Methods
3415

35-
For more details on virtual environments, see the [Python documentation](https://docs.python.org/3/tutorial/venv.html).
3616

37-
## Installation Methods
3817

18+
### From Source
19+
20+
Highly recommended to install DeePTB from source to get the latest features and bug fixes.
21+
1. **Setup Python environment**:
22+
23+
Using conda (recommended, python >=3.9, <=3.12 ), e.g.,
24+
```bash
25+
conda create -n dptb_venv python=3.10
26+
conda activate dptb_venv
27+
```
28+
or using venv (make sure python >=3.9,<=3.12)
29+
```bash
30+
python -m venv dptb_venv
31+
source dptb_venv/bin/activate
32+
33+
2. **Clone DeePTB and Navigate to the root directory**:
34+
```bash
35+
git clone https://github.com/deepmodeling/DeePTB.git
36+
cd DeePTB
37+
```
38+
3. **Install `torch` and `torch-scatter`** (two ways):
39+
- **Recommended**: Install torch and torch-scatter using the following commands:
40+
41+
```bash
42+
python docs/auto_install_torch_scatter.py
43+
```
44+
45+
- **Manual**: Install torch and torch-scatter manually:
46+
1. install torch:
47+
```bash
48+
pip install "torch>=2.0.0,<=2.5.0"
49+
```
50+
51+
2. install torch-scatter:
52+
```bash
53+
pip install torch-scatter -f https://data.pyg.org/whl/torch-${version}+${CUDA}.html
54+
```
55+
where `${version}` is the version of torch, e.g., 2.5.0, and `${CUDA}` is the CUDA version, e.g., cpu, cu118, cu121, cu124. See [torch_scatter doc](https://github.com/rusty1s/pytorch_scatter) for more details.
56+
57+
4. **Install DeePTB**:
58+
```bash
59+
pip install .
60+
```
61+
3962
### From PyPi
4063

4164
1. Install PyTorch first by following the instructions on [PyTorch: Get Started](https://pytorch.org/get-started/locally).
@@ -44,22 +67,6 @@ For more details on virtual environments, see the [Python documentation](https:/
4467
pip install dptb
4568
```
4669

47-
### From Source
48-
49-
1. Clone the DeePTB repository:
50-
```bash
51-
git clone https://github.com/deepmodeling/DeePTB.git
52-
```
53-
2. Change to the repository directory:
54-
```bash
55-
cd DeePTB
56-
```
57-
3. Install DeePTB and its dependencies:
58-
```bash
59-
pip install .
60-
```
61-
62-
6370
### Additional Tips
6471

6572
- Keep your DeePTB installation up-to-date by pulling the latest changes from the repository and re-installing.

0 commit comments

Comments
 (0)