Installing pycart

Before installing pycart, make sure you have the latest version of pip:

py -m pip install --upgrade pip

Installing from PyPI

The latest stable version of pycart can be installed from PyPI:

pip install pycart

Installing from TestPyPI

The most recent development version of pycart can be installed from TestPyPI:

pip install -i https://test.pypi.org/simple/ pycart

Installing from Source

Download the source (tar.gz) from PyPI or from the latest development version on GitHub.

Unpack and change to the source directory (which should contain the README.md); for the purposes of this guide, the source folder will be referred to by the filepath ./pycart.

pycart was originally built and packaged using Poetry, so pycart can be installed from source using either poetry or regularly using python.

Installing with poetry

First, make sure you have the latest version of Poetry installed (please see their installation guide) and ensure that you have configured Poetry to create Virtual Environments in the working directory:

poetry config virtualenvs.in-project true

Navigate to the extracted source folder:

cd './pycart'

Create a new virtual environment using Poetry:

poetry env use python

This will create a new environment in the pycart directory that uses the latest version of Python.

Now, you can install all dependencies from source and subsequently install pycart:

poetry install

Installing with pip

If you do not have Poetry installed, you can install pycart from source using pip.

First, make sure you have the latest version of pip installed:

py -m pip install --upgrade pip

Next, create a new virtual environment in the source directory:

python -m venv .venv

Activate the virtual environment using the following command:

.venv/Scripts/activate.bat

Install the dependencies required by pycart first:

py -m pip install -r requirements.txt

Finally, install the pycart package from the source directory:

pip install -e './pycart'

Key Dependencies

To use pycart, you will need Python>=3.9, alongside the following fixed version dependencies:

Package Version
Python >=3.9, <3.12
matplotlib 3.7.1
geopandas 0.12.2
geojson 3.0.1
pandas 1.5.3
numpy 1.24.2
libpysal 4.7.0
shapely 2.0.1
alive-progress >3.1.1