Skip to content

Step by step Installation Guide

Jens Janssen edited this page Feb 4, 2019 · 40 revisions

Step-by-step Installation Guide

The following step-by-step installation guide explains in detail how you can setup pyBAR under Windows, Linux or OS X operating system. This guide addresses users, that do not have python or git experience.
Thus only one verified way of setting up pyBAR is explained here. The guide can be expected to work if the instructions are carefully followed. In case of troubles, don’t hesitate to ask questions on the pyBAR mailing list (subscription required) or file a bug report/feature request here

  1. Installing Miniconda Python
    Miniconda Python is a Python distribution providing a simple to use package manager to install lots of Python packages for data analysis, plotting and I/O. These packages are heavily used in pyBAR.
    Download and install Miniconda by following this link: Continuum Miniconda. PyBar supports Python 2.7.x but not Python 3 and newer.
    Note: Select the Python 2.7 version according to your operating system architecture (e.g. 64-bit Python on 64-bit operating system)
    Note: We strongly recommend installing a 64-bit operating system.
     
  2. Installing C++ Compiler
    Linux: Install gcc via package manager, e.g. on Ubuntu run:
    sudo apt-get install build-essential
    Windows: Install Microsoft Visual C++ Compiler for Python 2.7
    OS X: Install Xcode from App Store and install Xcode Command Line Tools by running:
    xcode-select --install
  3. Installing Eclipse with PyDev
    Eclipse is a state of the art Integrated Development Environment (IDE) for almost every important software programming language (JAVA, C++, Python, Fortran, Ruby, Mathematica). It has a plug in system to extend the development environment. PyDev is the Python IDE plugin for Eclipse.
    1. Eclipse needs a Java runtime environmet (JRE) and will not start if this is not installed. Windows: It is recommend to use the Eclipse 32-bit version, even on a 64-bit machine. Since Eclipse 64-bit needs JRE 64-bit and Oracle JRE 64-bit does not provide automatic updates. This puts the PC at risk of viruses.
    2. Download the Eclipse installer from Eclipse Homepage and choose Eclipse for C/C++ developers during installation.
    3. Eclipse asks for a workspace path where the projects will be located on your hard drive. Standard settings are sufficient.
    4. Close the welcome screen.
    5. Install the PyDev plugin by clicking on Help → Install New Software . Press add and fill the form (name = PyDev, location = http://pydev.org/updates):
       

       
      Select PyDev and install (accept license agreement and trust the certificate).
    6. Add PyDev perspective to Eclipse and select it. The button is located in the upper rigth corner:
       

       
    7. Goto Window → Preferences → PyDev → Interpreters→ Python Interpreter and press new.
       

       
      Select the Python executable in /home//miniconda/bin/ on Linux or c:\Miniconda\ on Windows (optionally use the Miniconda/env// folder if you are using Miniconda environments) and press the OK button. Everything is set up automatically.
      More details are given here.
       
  4. Installing Required Packages
    1. Installing Python Packages
      Open a console and type one by one:
      conda update conda
      conda update --all
      conda install python=2.7 bitarray contextlib2 cython ipython matplotlib mock nose numba numpy pyqt pyserial pytables pyyaml pyzmq qtpy scipy
      pip install progressbar-latest pyvisa pyvisa-py git+https://github.com/pyqtgraph/pyqtgraph.git@pyqtgraph-0.10.0
      On Windows additionally run:
      conda install pywin32
      Note: Updating packages requires the following commands:
      First run
      conda update conda
      to update conda itself and then
      conda update --all
      or
      pip install -U --no-deps [package name]
      to update a single package.
    2. Installing Packages for USB support (libusb, PyUsb and pySiLibUsb)
      The installation process is described in the pySiLibUSB wiki.
      Linux: If you run a Linux based operating system, a udev rule has to be provided to change device permission. Please read the pySiLibUSB wiki carefully.
      Note: Only required for USBpix2. Other supported readout hardware uses SiTCP.
    3. Installing Basil
      Basil (package name basil_daq) is required for pyBAR and is used to access the test setup hardware. The latest stable version
      is automatically installed, when the pyBAR setup is ran. You do not have to do anything at this point.
       
  5. Cloning pyBAR
    1. In Eclipse, goto File→Import→Git and select Projects from Git
    2. Click clone URI and type the pyBAR repository (URI: https://github.com/SiLab-Bonn/pyBAR)
    3. If you have a GitHub account you can add the credentials here
    4. Click next, select all branches, click next and specify the directory where pyBAR will be cloned to
    5. If you want the latest stable tag select the master branch. If you want to have the newest features or contribute to pyBAR select development
    6. Wait until the download of the code is finished and check Import as project configured using the New Project Wizard
    7. Select PyDev → PyDevProject
    8. Give the project a name, select the folder where the pyBAR was cloned to (e.g. /home/username/git/pyBAR) and click finish
  1. Installing pyBAR
    Open the shell and change to the pyBAR git directory where the pyBAR was cloned to. Inside the pyBAR folder, where the setup.py file is located, run:
    python setup.py develop
    This will add pyBAR to the Python environment.
     
  2. Installing ViTables data viewer and Plotting Plug-in (optional)
    ViTables is a open source data viewer for viewing and editing HDF5 files created by PyTables. PyBAR stores raw data (e.g. FEI4 raw data), interpreted data and histograms in HDF5 files. A simple plugin pyBAR was written to allow the creation of plots from pyBAR data within ViTables.
    1. Installing ViTables from GitHub
      Clone the ViTables git repository:
      git clone https://github.com/uvemas/ViTables.git
      When using Anaconda/Miniconda Python, edit the setup.py and remove the PyQt5 dependency (remove the line with 'PyQt5 (>=5.5.1)',) and run:
      conda install qtpy pyqt pytables numpy numexpr
      Finally install with:
      python setup.py install
    2. Setting up the pyBAR Plotting Plug-in (optional)
      1. Open ViTables and go to Settings→Preferences→Plugins and add the pyBAR plugin folder via pressing New:
         

         
      2. Restart ViTables and add the pybar_vitables_plugin in the same settings dialog:
         

         
      3. After a restart you can right click in the Tree of databases and select plot pyBAR data to get a plot from the selected leaf.
Clone this wiki locally