Skip to main content
`Ctrl`+`K`

# Installation

RosettaSciIO can be installed with pip, conda, the hyperspy:hyperspy-bundle, or from source, and supports Python >= 3.8. All alternatives are available on Windows, macOS and Linux.

For using HyperSpy, it is not necessary to install RosettaSciIO separetely, as it would be installed automatically when installing HyperSpy.

## With pip

RosettaSciIO is availabe from the Python Package Index (PyPI), and can therefore be installed with pip. To install with all optional dependencies:

    pip install rosettasciio[all]

To install without optional dependencies:

    pip install rosettasciio

To update RosettaSciIO to the latest release:

    pip install --upgrade rosettasciio

To install a specific version of RosettaSciIO (say version 0.1):

    pip install rosettasciio==0.1

### Optional dependencies

Some functionality is optional and requires extra dependencies which must be installed manually or by using extra:

Install all optional dependencies:

    pip install rosettasciio[all]

The list of extras:

Extra | Dependencies | Usage
--- | --- | ---
`blockfile` | `scikit-image` | Data normalisation
`eds-steam` | `sparse` | Loading EDS data stream (JEOL `pts`, Velox `emd`)
`hdf5` | `h5py` | Reading hdf5-based file formats (`hspy`, `de5`, `emd`, `usid`, etc.)
`image` | `imageio` | Reading images, other than tiff format.
`mrcz` | `blosc`, `mrcz` | Readding `mrc` and `mrcz` format.
`scalebar_export` | `matplotlib-scalebar` | Exporting image with scalebar.
`speed` | `numba` | Speed up loading some data, for example EDS data.
`tiff` | `tifffile` | Read `tiff` files.
`usid` | `pyUSID` | Read `usid` files.
`zspy` | `zarr` | Read `zspy` files.

And for development, the following extras are available (see `pyproject.toml` for more information):

- tests

- doc

- dev

## With conda

To install with conda, we recommend you install it in a conda environment with the Miniforge distribution. To create an environment and activate it:

    conda create --name rsciio python=3.11
    conda activate rsciio

To install rosettasciio with all dependencies:

    conda install rosettasciio

To install rosettasciio without any dependencies:

    conda install rosettasciio-base

To update RosettaSciIO to the latest release:

    conda update rosettasciio

To install a specific version of RosettaSciIO (say version 0.1):

    conda install rosettasciio=0.1

Note

Conda used to be slow to install dependencies in large enviroment and mamba could be used as a fast drop-in replacement. However, since conda release 23.10, mamba and conda use the same “solver” and therefore takes similar time to “solve environment”. See the conda blog for more information.

## With the HyperSpy Bundle

The HyperSpy Bundle comes with RosettaSciIO and all its extras pre-installed. See hyperspy:hyperspy-bundle for instructions.

## From source

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

    git clone https://github.com/hyperspy/rosettasciio.git
    cd rosettasciio
    pip install --editable .

Note

If setuptools_scm is installed, the version will be determined from the git repository at runtime, otherwise, the version will be the one at build time.

To install a development version on CI, it is advised to use pip with vcs support in order to get the correct development version, e.g. `0.3.dev14+g706deac`:

    pip install git+https://github.com/hyperspy/rosettasciio.git