Skip to content

Commit 841c937

Browse files
committed
[Docs] add installation instructions with uv, poetry, conda
1 parent 5d20509 commit 841c937

File tree

2 files changed

+57
-12
lines changed

2 files changed

+57
-12
lines changed

Diff for: README.md

+3-10
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<a href="https://pytorchlightning.ai/"><img alt="Lightning" src="https://img.shields.io/badge/-Lightning-792ee5?logo=pytorchlightning&logoColor=white"></a>
1111
<a href="https://github.com/pytorch/rl"><img alt="base: TorchRL" src="https://img.shields.io/badge/base-TorchRL-red"></a>
1212
<a href="https://hydra.cc/"><img alt="config: Hydra" src="https://img.shields.io/badge/config-Hydra-89b8cd"></a>
13-
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
13+
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
1414
<a href="https://join.slack.com/t/rl4co/shared_invite/zt-1ytz2c1v4-0IkQ8NQH4TRXIX8PrRmDhQ"><img alt="Slack" src="https://img.shields.io/badge/slack-chat-611f69.svg?logo=slack"></a>
1515
<a href="https://opensource.org/licenses/MIT"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-red.svg"></a>
1616
<a href="https://colab.research.google.com/github/ai4co/rl4co/blob/main/examples/1-quickstart.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a>
@@ -89,7 +89,7 @@ git clone https://github.com/ai4co/rl4co && cd rl4co
8989
pip install -e .
9090
```
9191

92-
We recommend using a virtual environment such as `conda` to install `rl4co` locally.
92+
We recommend installing in virtual environments with a package manager such as the blazing-fast [`uv`](https://docs.astral.sh/uv/), [`poetry`](https://python-poetry.org/), or [`conda`](https://docs.conda.io/en/latest/); instruction are available in the [documentation](https://rl4.co/docs/content/start/installation/).
9393

9494

9595

@@ -174,14 +174,7 @@ pytest tests
174174

175175
### Known Bugs
176176

177-
178-
#### Bugs installing PyTorch Geometric (PyG)
179-
180-
Installing `PyG` via `Conda` seems to update Torch itself. We have found that this update introduces some bugs with `torchrl`. At this moment, we recommend installing `PyG` with `Pip`:
181-
```bash
182-
pip install torch_geometric
183-
```
184-
177+
You may check out the [issues](https://github.com/ai4co/rl4co/issues) and [discussions](https://github.com/ai4co/rl4co/discussions). We will also periodically post updates on the [FAQ section](https://rl4.co/docs/content/general/faq/).
185178

186179
## Contributing
187180

Diff for: docs/content/start/installation.md

+54-2
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,66 @@ pip install rl4co
88
```
99

1010
## Local install and development
11-
If you want to develop RL4CO or access the latest builds, we recommend you to install it locally with `pip` in editable mode:
11+
If you want to develop RL4CO or access the latest builds, you may install it locally after downloading the repo:
1212

1313
```bash
1414
git clone https://github.com/ai4co/rl4co && cd rl4co
15+
```
16+
17+
The simplest way is via `pip` in editable mode with
18+
```bash
1519
pip install -e .
1620
```
1721

18-
> Note: `conda` is also a good candidate for hassle-free installation of PyTorch: check out the [PyTorch website](https://pytorch.org/get-started/locally/) for more details.
22+
To install optional dependencies, you may specify them as follows `pip install -e ".[dev,graph,routing,docs]"`.
23+
24+
We recommend installing in virtual environments with a package manager such as the blazing-fast [`uv`](https://docs.astral.sh/uv/), [`poetry`](https://python-poetry.org/), or [`conda`](https://docs.conda.io/en/latest/), with quickstart commands below:
25+
26+
<details>
27+
<summary>Install with `uv`</summary>
28+
29+
You first need to install `uv`, i.e., with `pip`:
30+
```bash
31+
pip install uv
32+
```
33+
34+
Then, you can create a virtual environment locally and activate it:
35+
```bash
36+
uv sync --frozen
37+
source .venv/bin/activate
38+
```
39+
40+
Note that `uv` directly generates the `.venv` folder in the current directory.
41+
42+
43+
</details>
44+
45+
46+
<details>
47+
<summary>Install with `poetry`</summary>
48+
49+
Make sure that you have `poetry` installed from the [official website](https://python-poetry.org/docs/).
50+
51+
Then, you can create a virtual environment locally:
52+
```bash
53+
poetry install
54+
poetry env activate # poetry shell removed in poetry 2.0.0
55+
```
56+
57+
Note: you need to upgrade `poetry` to the latest version with `poetry self update` to versions >=2.0.0 (see [blog post](https://python-poetry.org/blog/announcing-poetry-2.0.0/)). This is also the reason why we don't need a special `pyproject.toml` anymore.
58+
59+
</details>
60+
61+
62+
<details>
63+
<summary>Install with `conda`</summary>
64+
65+
After [installing `conda`](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html), you can create a virtual environment locally with:
66+
```bash
67+
conda create -n rl4co python=3.12
68+
conda activate rl4co
69+
```
70+
</details>
1971

2072

2173
## Minimalistic Example

0 commit comments

Comments
 (0)