Cockpit is available on the Python Package Index (PyPI) and can be installed like any other Python package. The short version is:
pip install microscope-cockpit
For platform-specific instructions, details, and caveats, see below.
Once installed, Cockpit can be started from command line:
In the absence of configuration files, Cockpit will simulate the required devices. See the configuration section for details on how to configure Cockpit to control real devices.
Linux systems have a package manager but Cockpit and some of its dependencies are not always available. To avoid conflicts, it is a good idea to avoid installing packages with the Python package manager if they are available via the system package manager.
Debian based distributions (such as Ubuntu)¶
The only Cockpit dependency not available on Debian repositories is microscope which can be installed with pip. To avoid having pip installing the other dependencies from PyPI, they need to be installed first with apt:
sudo apt install \ python3 \ python3-freetype \ python3-matplotlib \ python3-numpy \ python3-opengl \ python3-pip \ python3-pyro4 \ python3-scipy \ python3-serial \ python3-setuptools \ python3-wxgtk4.0
Older versions of Debian and Ubuntu may not have some of the
dependencies packaged, namely freetype-py. In such case, simply
omit them from the
apt install command and let pip install
them as part of pip automatic handling of missing dependencies.
Once that is done, installing Cockpit with pip will install any missing dependencies:
pip3 install --user microscope-cockpit
The easiest method to install Cockpit on macOS is to install the python.org build of the latest python version and then use pip to install cockpit and its dependencies:
1. Download and install the latest Python 3 from python.org.
2. Once python is installed open a terminal window
/Application/Utilities/Terminal) and use pip to install
Cockpit. You must use
pip3 to use the newly installed Python 3
rather than the system default Python 2.7:
pip3 install microscope-cockpit
3. This may prompt you to install the XCode command line utilities.
Please install these as they are required for some of the instrument
control functionality in Cockpit. If this step is required you will
have to rerun the
pip3 install command above as it will have
failed the first time.
Once installed, cockpit can be started from command line:
Python must be installed first, and the installer can be downloaded
During the Python installation, ensure that pip is also installed
(it will be by default) and that the install and scripts directories
are added to Windows
PATH (check the “Add Python X.Y to PATH”
option during installation).
Once Python is installed, Cockpit can be installed with pip like so:
pip install microscope-cockpit
Cockpit development happens in a public git repository making it possible to install cockpit from development sources:
git clone https://github.com/MicronOxford/cockpit.git pip install cockpit/
If the plan is to make changes to the source code or to have the installed version follow development, consider installing in develop mode, also known as editable mode:
pip install --user --editable cockpit/