Installing

Installing with pip (platform-independent)

Sardana can be installed using pip. The following command will automatically download and install the latest release of Sardana (see pip3 –help for options):

pip3 install sardana

Note that for sardana > 3.4.0, this will only install the minimal dependencies. To install all dependencies, use:

pip3 install "sardana[all]"

If you only want dependencies to run Spock and Sardana-Taurus Extension widgets:

pip3 install "sardana[spock,qt]"

For only Sardana configuration dependencies, you can use:

pip3 install "sardana[config]"

You can test the installation by running:

python3 -c "import sardana; print(sardana.__version__)"

Note: Installing sardana with pip3 might require building PyTango (one of the sardana’s dependencies) if no wheel is available for your platform. You could use Installing in a conda environment (platform-independent) to avoid this. If you decide to continue with pip3, please refer to PyTango’s installation guide. On Debian this should work to prepare the build environment:

apt-get install pkg-config libboost-python-dev libtango-dev

Linux (Debian-based)

Sardana is part of the official repositories of Debian (and Ubuntu and other Debian-based distros). You can install it and all its dependencies by doing (as root):

apt-get install python3-sardana

Note: python3-sardana package is available starting from the Debian 11 (Bullseye) release. For previous releases you can use python-sardana (compatible with Python 2 only).

Installing in a conda environment (platform-independent)

In a conda environment (we recommend creating one specifically for sardana):

conda install -c conda-forge sardana

Since version 3.4.0, sardana is a metapackage that will install sardana and all optional dependencies. For minimal requirements, install sardana-core instead. See sardana-feedstock for the up-to-date list of packages.

Working from Git source directly (in develop mode)

If you intend to do changes to Sardana itself, or want to try the latest developments, it is convenient to work directly from the git source in “develop” (aka “editable”) mode, so that you do not need to re-install on each change:

# optional: if using a conda environment, pre-install dependencies with:
conda install --only-deps -c conda-forge sardana-core taurus-qt
# for sardana config dependencies
conda install -c conda-forge dsconfig pyyaml ruamel.yaml pydantic jsonpatch

# install sardana in develop mode
git clone https://gitlab.com/sardana-org/sardana.git
cd sardana
pip3 install -e ".[all]"  # <-- Note the -e !!

Dependencies

Sardana depends on PyTango, Taurus, lxml, itango and click. However some Sardana features require additional dependencies. For example:

  • Using the Sardana Qt widgets, requires either PyQt (v4 or v5) or PySide (v1 or v2).

  • The macro plotting feature requires matplotlib

  • The showscan online widget requires pyqtgraph

  • The showscan offline widget requires PyMca5

  • The QtSpock widget requires qtconsole

  • The HDF5 NeXus recorder requires h5py