Installing pykanto#

Basic installation#

To install pykanto using pip, run:

pip install pykanto


Tip: avoid a dependency hell!

It is possible to use pip and install pykanto outside of a virtual environment, but this is not advised. Virtual environments create a clean Python environment that does not interfere with any existing system installation, can be easily removed, and contain only the package versions your application needs. They help avoid a common challenge known as dependency hell. [scikit-image docs]

I highly recommend that you create a new environment, for example with conda:

conda create -n pykanto-env python==3.9 && conda activate pykanto-env      

And only then install pykanto.

Installing GPU-accelerated and ML libraries#

Under the hood, pykanto uses some libraries and algorithms (like UMAP) that can run much faster on a GPU. If you have a CUDA-supported GPU and install RAPIDS’s cuML in the same environment, pykanto will detect it and switch to the faster GPU implementation.

I recommend that, if this is the case, you first create a fresh environment with conda:

conda create -n pykanto-env python==3.9             

And then install cuML & pykanto, in that order.

conda install -c rapidsai -c nvidia -c conda-forge cuml 
pip install pykanto

(Also see the rapids release selector.)

The same is true if you want to install pytorch; the preferred order would be:

# pytorch and cuML installation via conda
conda install -c rapidsai -c nvidia -c conda-forge cuml
conda install -c pytorch pytorch torchvision   
pip install pykanto

Developer installation#

If you want to contribute to the project, you can install it in editable mode along with the development dependencies such as pytest, nox or sphinx, necessary for testing and generating the documentation.

git clone https://github.com/nilomr/pykanto.git
cd pykanto
pip install -e '.[dev, test, doc]'

OS support#

pykanto is developed and tested on Linux. It should also work on macOS and Windows but you might need to install some extra dependencies manually and encounter more wrinkles. If you do, please let me know by opening an issue or a pull request.

Apple silicon support#

This is currently not tested. Thanks to a kind reviewer for pointing out that this installation steps might be necessary to get pykanto to work on machines running Apple Silicon:

# Within your conda environment:
pip uninstall grpcio # if installed
conda install grpcio
conda install -c conda-forge libsndfile
pip install pykanto

See also: ray apple silicon support, sndfile library missing.