Skip to content
Merged
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
32 changes: 21 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,23 @@ Please refer to [the preCICE documentation](https://www.precice.org/installation

## Installing the package

We recommend using pip3 (version 19.0.0 or newer required) for the sake of simplicity. You can check your pip3 version via `pip3 --version`. To update pip3, use the following line:
Generally, it is recommended to work in a virtual environment when using the preCICE Python bindings. For this purpose, you might have to run `apt install python3-venv` first.

Create a virtual environment in your working directory by running:

```bash
python3 -m venv .venv
```

Using `.venv` is a common choice as path of your virtual environment. But you can use any path here. Activate the virtual environment by running

```bash
$ pip3 install --user --upgrade pip
. .venv/bin/activate
```

### Using pip3
### Using pip

We recommend using `pip` (version 19.0.0 or newer required). You can check your pip version via `pip --version`.

#### preCICE system installs

Expand All @@ -35,19 +45,19 @@ For system installs of preCICE, installation works out of the box. There are dif
* (recommended) install [pyprecice from PyPI](https://pypi.org/project/pyprecice/)

```bash
$ pip3 install --user pyprecice
$ pip install pyprecice
```

* provide the link to this repository to pip (replace `<branch>` with the branch you want to use, preferably `master` or `develop`)

```bash
$ pip3 install --user https://github.com/precice/python-bindings/archive/<branch>.zip
$ pip install https://github.com/precice/python-bindings.git@<branch>
```

* if you already cloned this repository, execute the following command from this directory:

```bash
$ pip3 install --user .
$ pip install .
```

*note the dot at the end of the line*
Expand All @@ -65,30 +75,30 @@ The preCICE documentation provides more informaiton on [linking preCICE](https:/

You can also install the python language bindings for preCICE via Spack by installing the Spack package `py-pyprecice`. Refer to [our installation guide for preCICE via Spack](https://precice.org/installation-spack.html) for getting started with Spack.

### Using setup.py
### Using setup.py (deprecated)

#### preCICE system installs

In this directory, execute:

```bash
$ python3 setup.py install --user
$ python3 setup.py install
```

#### preCICE at custom location (setting PATHS)

see above. Then run

```bash
$ python3 setup.py install --user
$ python3 setup.py install
```

#### preCICE at custom location (explicit include path, library path)

1. Install cython and other dependencies via pip3

```bash
$ pip3 install --user setuptools wheel cython packaging numpy
$ pip3 install setuptools wheel cython packaging numpy
```

2. Open terminal in this folder.
Expand All @@ -110,7 +120,7 @@ $ python3 setup.py install --user
4. Install the bindings

```bash
$ python3 setup.py install --user
$ python3 setup.py install
```

5. Clean-up *optional*
Expand Down