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
You can test the installation by running:
python3 -c "import sardana; print(sardana.Release.version)"
Note: Installing sardana with pip3 on Linux requires building PyTango (one of the sardana’s dependencies). 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
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
python3-sardana package is available starting from the Debian 11
(Bullseye) release. For previous releases you can use
(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
Note: for Windows, until PyTango is available on conda-forge, you may need to use
pip3 install pytango for installing it.
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 # install sardana in develop mode git clone https://gitlab.com/sardana-org/sardana.git pip3 install -e ./sardana # <-- Note the -e !!