Skip to content

Installation

Requirements

lonpy requires Python 3.10 or higher.

Install from PyPI

The simplest way to install lonpy is via pip:

pip install lonpy

Install from Source

For the latest development version:

git clone https://github.com/agh-a2s/lonpy.git
cd lonpy
pip install -e .

Dependencies

lonpy automatically installs the following dependencies:

Package Version Purpose
numpy >= 1.24.0 Numerical computations
scipy >= 1.10.0 Optimization algorithms
pandas >= 2.0.0 Data manipulation
igraph >= 0.11.0 Graph operations
matplotlib >= 3.7.0 2D plotting
plotly >= 5.15.0 Interactive 3D plots
kaleido >= 0.2.1 Static image export
imageio >= 2.31.0 GIF creation

Development Installation

To install lonpy with development dependencies for contributing:

git clone https://github.com/agh-a2s/lonpy.git
cd lonpy
pip install -e ".[dev]"

This includes:

  • pytest - Testing framework
  • pytest-cov - Coverage reporting
  • ruff - Linting and formatting
  • mypy - Type checking
  • pre-commit - Git hooks

Verifying Installation

After installation, verify everything works:

import lonpy
print(lonpy.__version__)

You should see the version number (e.g., 0.1.0).

Troubleshooting

igraph Installation Issues

On some systems, you may need to install igraph system dependencies first:

sudo apt-get install build-essential python3-dev libxml2-dev zlib1g-dev
pip install lonpy
brew install igraph
pip install lonpy

igraph typically installs without issues on Windows via pip.

Plotly/Kaleido Issues

If you encounter issues with static image export:

pip install --upgrade kaleido

On some systems, you may need:

pip install kaleido==0.2.1