Installation

This page guides you through installing the k-diagram package. Choose the method that best suits your needs.

Requirements

Before installing, ensure you have the following prerequisites:

  • Python: Version 3.6 or higher.

  • Core Dependencies: k-diagram relies on several standard

    scientific Python libraries: * numpy * pandas * scipy * matplotlib * seaborn * scikit-learn

    These dependencies are typically installed automatically when you install k-diagram using pip.

Installation from Source (for Development)

If you want to contribute to k-diagram, modify the code, or use the very latest (potentially unstable) version, you can install it from the source repository on GitHub.

  1. Clone the repository: First, clone the repository to your local machine using Git:

    git clone https://github.com/earthai-tech/k-diagram.git
    cd k-diagram
    
  2. Install in editable mode: Install the package in “editable” mode using pip. This links the installed package directly to your cloned source code, so any changes you make are immediately reflected without reinstalling.

    It’s also recommended to install the optional development dependencies ([dev]), which include tools for testing and building documentation:

    pip install -e .[dev]
    
    • The -e flag stands for “editable”.

    • The . refers to the current directory (the cloned repo root).

    • [dev] installs the extra dependencies listed under “dev”

      in setup.py (like pytest, sphinx).

Verifying the Installation

After installation, you can verify it by importing the package in a Python interpreter or script:

1import kdiagram
2
3try:
4    print(f"k-diagram version: {kdiagram.__version__}")
5except AttributeError:
6    print("Could not determine k-diagram version.")

If this runs without errors, the installation was likely successful.

Troubleshooting

If you encounter issues during installation:

  • Ensure you have a compatible version of Python installed and that

    pip is up-to-date (pip install --upgrade pip).

  • Check that you have the necessary build tools if installing from

    source or if a dependency requires compilation.

  • If you face persistent problems, please consult the project’s

    GitHub Issues page. Search for similar issues or open a new one with details about your environment and the error message.