Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add conda-forge install instructions #1340

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 26 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![PyPI version](https://badge.fury.io/py/sbi.svg)](https://badge.fury.io/py/sbi)
[![Conda Version](https://img.shields.io/conda/vn/conda-forge/sbi.svg)](https://github.com/conda-forge/sbi-feedstock)
[![Contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/sbi-dev/sbi/blob/master/CONTRIBUTING.md)
[![Tests](https://github.com/sbi-dev/sbi/actions/workflows/ci.yml/badge.svg)](https://github.com/sbi-dev/sbi/actions)
[![codecov](https://codecov.io/gh/sbi-dev/sbi/branch/main/graph/badge.svg)](https://codecov.io/gh/sbi-dev/sbi)
Expand Down Expand Up @@ -62,22 +63,36 @@ posterior = inference.build_posterior()
performance in some cases. We recommend using a virtual environment with
[`conda`](https://docs.conda.io/en/latest/miniconda.html) for an easy setup.

To install `sbi`, follow these steps:
If `conda` is installed on the system, an environment for installing `sbi` can be created as follows:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section required restructuring as otherwise you're interviewing too many different (and not needed) ideas of different environment management tools.

Revision requests welcome of course.


1. **Create a Conda Environment** (if using Conda):
```
conda create -n sbi_env python=3.9 && conda activate sbi_env
```

### From PyPI

To install `sbi` from PyPI run

```
python -m pip install sbi
```

```bash
conda create -n sbi_env python=3.9 && conda activate sbi_env
```
### From conda-forge

2. **Install `sbi`**: Independent of whether you are using `conda` or not, `sbi` can be
installed using `pip`:
To install and add `sbi` to a project with [`pixi`](https://pixi.sh/), from the project directory run

```
pixi add sbi
```

and to install into a particular conda environment with [`conda`](https://docs.conda.io/projects/conda/), in the activated environment run

```
conda install --channel conda-forge sbi
```

```commandline
pip install sbi
```
### Test the installation

3. **Test the installation**:
Open a Python prompt and run

```python
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ samples = posterior.sample((1000,), x=x_o)
**To get started, install the `sbi` package with:**

```commandline
pip install sbi
python -m pip install sbi
```

for more advanced install options, see our [Install Guide](install.md).
Expand Down
22 changes: 17 additions & 5 deletions docs/docs/install.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,35 @@
# Installation

`sbi` requires Python 3.8 or higher. A GPU is not required, but can lead to
`sbi` requires Python 3.9 or higher. A GPU is not required, but can lead to
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modern sbi requires Python 3.9+

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, thanks!

speed-up in some cases. We recommend using a
[`conda`](https://docs.conda.io/en/latest/miniconda.html) virtual environment
([Miniconda installation
instructions](https://docs.conda.io/en/latest/miniconda.html)). If `conda` is
installed on the system, an environment for installing `sbi` can be created as
follows:

```commandline
```console
# Create an environment for sbi (indicate Python 3.8 or higher); activate it
$ conda create -n sbi_env python=3.10 && conda activate sbi_env
$ conda create -n sbi_env python=3.12 && conda activate sbi_env
```

Independent of whether you are using `conda` or not, `sbi` can be installed
using `pip`:

```commandline
pip install sbi
```
python -m pip install sbi
```

To install and add `sbi` to a project with [`pixi`](https://pixi.sh/), from the project directory run

```
pixi add sbi
```

and to install into a particular conda environment with [`conda`](https://docs.conda.io/projects/conda/), in the activated environment run

```
conda install --channel conda-forge sbi
```

To test the installation, drop into a Python prompt and run
Expand Down
Loading