# 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`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cipipe.gitbook.io/cipipe-docs/installing-the-library.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
