> For the complete documentation index, see [llms.txt](https://cipipe.gitbook.io/cipipe-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cipipe.gitbook.io/cipipe-docs/installing-the-library.md).

# Installing the Library

1. Install the library from PyPI

```bash
pip install cipipeline
```

2. Install libraries/packages required for specific modules

   Currently, CIPipeline supports the following optional modules:

   * **Inscopix `isx`** (required for the `isx` module): Software and installation instructions can be downloaded from the vendor site: [https://www.inscopix.com](https://www.inscopix.com/)

     Note: Do not confuse this with the public `isx` library available on PyPI or GitHub. This project requires the proprietary Inscopix software package.
   * **CaImAn** (required for the `caiman` module):

     * Project: <https://github.com/flatironinstitute/CaImAn>
     * Docs: [https://caiman.readthedocs.io](https://caiman.readthedocs.io/)

     CaImAn strongly recommends installing via conda for full functionality; follow the CaImAn docs.
3. Jupyter (recommended for opening example notebooks)

```bash
pip install jupyterlab
# or
pip install notebook
```

This package requires **Python 3.10 or 3.10.x** (not compatible with 3.11 or higher).&#x20;

At this point, the library should be correctly installed.

Useful documentation and download links:

* **PyPI package:** <https://pypi.org/project/cipipeline>
* **Jupyter starter guide:** <https://jupyter.org/install>

***

### Using a Virtual Environment

It is recommended to install the library inside a virtual environment.\
You can create and activate one using either **venv** or **conda**:

#### Using `venv`

```bash
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install cipipeline
```

#### Using `conda`

```bash
conda create -n cipipeline python=3.10
conda activate cipipeline
pip install cipipeline
```

***

### Installing from `requirements.txt`

If you cloned the repository locally, you can install the dependencies listed in `requirements.txt`:

```bash
pip install -r requirements.txt
```

Alternatively, if you are working inside a subdirectory (for example, within `examples/`) and want to install dependencies without relying on a global path, you can locate the `requirements.txt` file dynamically:

```
import os
upper_root = os.path.abspath(os.path.join(os.getcwd(), '../../..'))
requirements_path = os.path.join(upper_root, "requirements.txt")
!pip install -r $requirements_path
```

This approach installs all required dependencies while keeping your local version of the library importable (e.g., `from ci_pipe.pipeline import CIPipe`).

***

### Importing the Library

Once installed or if you are working locally, you can import the `CIPipe` class depending on your setup.

#### If installed from PyPI/TestPyPI

```python
from cipipeline import CIPipe
```

#### If working from the local source code

```python
from ci_pipe.pipeline import CIPipe
```

> **Note:**\
> Use the import path that matches your environment.\
> When using the published package, the module name is `cipipeline`.\
> When working directly from the source code, it is `ci_pipe`.
