Installation

kikuchipy can be installed from Anaconda, the Python Package Index (pip), from source, or using the HyperSpy Bundle, and supports Python >= 3.7. All alternatives are available on Windows, macOS, and Linux.

With Anaconda

To install with Anaconda, we recommend you install it in a conda environment with the Miniconda distribution. In the Anaconda Prompt, terminal, or Command Prompt, create an environment and activate it:

$ conda create --name kp-env python=3.9
$ conda activate kp-env

If you prefer a graphical interface to manage packages and environments, you can install the Anaconda distribution instead.

Installing:

$ conda install kikuchipy --channel conda-forge

To update kikuchipy to the latest release:

$ conda update kikuchipy

To install a specific version of kikuchipy (say version 0.3.4):

$ conda install kikuchipy==0.3.4

With pip

kikuchipy is listed in the Python Package Index (PyPI), and can therefore be installed with pip. To do so, run the following in the Anaconda Prompt, terminal or Command Prompt:

$ pip install kikuchipy

Note

kikuchipy builds upon HyperSpy, which depends upon a number of libraries that usually need to be compiled. Installing kikuchipy with pip may therefore require some development tools.

To update kikuchipy to the latest release:

$ pip install --upgrade kikuchipy

To install a specific version of kikuchipy (say version 0.3.4):

$ pip install kikuchipy==0.3.4

With the HyperSpy Bundle

The easiest way to install kikuchipy is via the HyperSpy Bundle. See HyperSpy’s documentation for instructions.

Warning

kikuchipy is updated more frequently than the HyperSpy Bundle, thus the installed version of kikuchipy will most likely not be the latest version available. See the HyperSpy Bundle repository for how to update packages in the bundle.

From source

To install kikuchipy from source, clone the repository from GitHub, and install with pip:

$ git clone https://github.com/pyxem/kikuchipy.git
$ cd kikuchipy
$ pip install --editable .

See the contributing guidelines for how to set up a development installation and keep it up to date.