---
title: "Installing Sprout"
order: 0
---

{{< include _preamble.qmd >}}

Before installing Sprout, you need to have
[Python](https://www.python.org/downloads/) and
[pipx](https://pipx.pypa.io/latest/installation/) installed.

To check that these programs are installed, run the following commands
in your Terminal:

``` {.bash filename="Terminal"}
python3 --version
pipx --version
```

If Python and pipx are installed, these commands will show you the
versions installed on your system. If you get an error, you need to
install them before continuing.

## Install Sprout in a virtual environment (recommended)

It's generally recommended to install Python packages in a virtual
environment to keep a project's dependencies separate from the
system-wide Python setup and avoid conflicts. There are several tools to
manage package dependencies and create virtual environments, such as
venv, virtualenv, and uv. For this guide, we will use
[uv](https://docs.astral.sh/uv/).

If you don't have uv installed, you can install it in your Terminal with
pipx:

``` {.bash filename="Terminal"}
pipx install uv
```

To check that uv is installed, run this command:

``` {.bash filename="Terminal"}
uv
```

You can create a Python project using [uv](https://docs.astral.sh/uv/).
In short, you can create a new project using uv by running the following
command in your Terminal (assuming we make a new data package called
`diabetes-study`):

``` {.bash filename="Terminal"}
uv init diabetes-study
```

This will create a new directory called `diabetes-study` with the basic
structure of a Python project. It should look like:

<!-- TODO: Auto-create this some how? -->

```
diabetes-study/
├── .git/
├── .gitignore
├── .python-version
├── README.md
├── main.py
└── pyproject.toml
```

uv also creates the folder as a Git repository. For more information on
working on projects with uv, see their
[guide](https://docs.astral.sh/uv/guides/projects/). Of the files
created, the most important ones for your data package are the
`pyproject.toml` and `main.py` files. The `pyproject.toml` file is used
to manage the dependencies of the project, while the `main.py` file is
where you will coordinate the Python scripts in your project.

<!-- TODO: eventually flip callout content so the template is recommended and not uv -->

::: callout-tip
You can generate the basic structure of a data package by using the
Seedcase Project
[`template-data-package`](https://github.com/seedcase-project/template-data-package).
There are instructions there on how to use it to make the initial
structure of a data package.
:::

After creating the project, open the project folder (in this case
`diabetes-study`) in your Terminal. Run the `pwd` command to confirm
that your working directory is the project folder.

You can now install Sprout directly from the [GitHub
repository](https://github.com/seedcase-project/seedcase-sprout):

``` {.bash filename="Terminal"}
uv add seedcase-sprout
```

Check that Sprout has been installed correctly by running this command:

``` {.bash filename="Terminal"}
uv pip show seedcase_sprout
```

If Sprout has been installed successfully, the output will show details
about Sprout.

Get started with your first data package by following the guide on
[Creating and managing data packages](/docs/guide/packages.qmd).

## Install Sprout in system-wide

We strongly recommend using Sprout in a virtual environment, but you can
also install it system-wide. The easiest way to do that is to use pipx:

``` {.bash filename="Terminal"}
pipx install seedcase-sprout
```

To check that Sprout has been installed correctly, run the following and
make sure `seedcase_sprout` is listed:

``` {.bash filename="Terminal"}
pipx list
```

Now you can use Sprout in any Python script throughout your computer.
