Linux Installation

Linux installation is broken up into two categories. The first is for end user installation and the second is for development. The installation guide uses Ubuntu Server 18.04 LTS. You may need to adapt some commands for your variant of Linux.

End User Installation

The majority of users will want to simply install the binary distribution of the library. This can be accomplished using pip. If we do not have a binary wheel for your operating system, you must follow the development installation guide.

pip install matrixprofile

Development Installation

Due to our usage of Cython and OpenMP for some modules, you are required to install some build essential dependencies. This portion of the installation guide will walk you through that.

Install Anaconda

Anaconda has become the defacto Python distribution for scientific computing and is highly recommended. You may use a base installation of Python without it, but this document does not cover that use case.

Download the command line installer of Anaconda from the Anaconda website.

Once the installation completes, you can run the following to keep your terminal session open. Note that all commands assume you installed Anaconda in your home directory.

source ~/.bashrc

Conda will now load the (base) environment when you launch a terminal.

Install Build Essential

Build essential is required to compile some modules using Cython.

sudo apt install build-essential

Install matrixprofile for Development

Finally, we can clone the matrixprofile source code and install it in development mode. If you wish, you may create a new Anaconda environment for this. Please refer to the Anaconda documentation to create a conda environment.

When I clone source code, I tend to favor putting all source files in a “src” directory within my home directory. Please substitute to suite your development preferences.

mkdir ~/src
cd ~/src
git clone https://github.com/matrix-profile-foundation/matrixprofile.git
cd matrixprofile

# for python 3.x
pip install -r requirements.txt

# for python 2.x
pip install -r python2-requirements.txt

pip install -e .

Once the installation completes, you can try running the tests to verify everything is OK.

pytest tests/

Please refer to our contribution guidelines for details on what we expect. Happy coding!