Skip to content

Step by step Installation Guide

D.-L.Pohl edited this page Feb 2, 2016 · 40 revisions

Step-by-step Installation Guide

The following step-by-step installation guide explains in more details how you can setup pyBAR under Windows, Linux or OS X operating system. 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 harddrive. 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).
      Linux: PyDev 3 is out and it needs Java 7, otherwise it will not show up in Eclipse without any error message. Please install java 7 and activate it. In Ubuntu activate it with
      sudo update-alternatives --config java
    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 install bitarray cython ipython matplotlib mock nose numpy pandas pyserial pytables pyyaml pyzmq scipy sphinx numba==0.22.1
      pip install progressbar-latest pyvisa pyvisa-py https://github.com/SiLab-Bonn/pyqtgraph/archive/develop.zip https://github.com/uvemas/ViTables/archive/v2.1.zip
      On Windows additionally run:
      conda install pywin32
      Note: Updating packages requires the following commands:
      conda update conda
      conda update --all
      pip install -U --no-deps [package name]
    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.
    3. Installing Basil
      Basil is required for pyBAR and is used to access the test setup hardware.
      Open the Basil wiki and follow the instructions.
      The procedure is:
      1. Clone the repository.
        The git version control system is required for the next steps.
        Cloning the entire Basil repository requires
        git clone https://github.com/SiLab-Bonn/basil 
        Checking out a specific tag/release:
        git tag -l
        git ckeckout -b tag_name tag_name
        Or a branch:
        git ckeckout branch_name
        Please refer the README for more details on the required version.
        Also note that the instructions in the README may vary depending on the pyBAR branch/tag.
        OR use the method described below on how to clone a git repository with Eclipse (Eclipse IDE already comes with git support).
      2. Open the shell and change to the Basil git directory where the Basil was cloned to. Inside the basil folder, where the setup.py file is located, run:
        python setup.py develop
        This will add Basil to the Python environment and makes it available for pyBAR.
         
  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 Check out 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

OR
use the method described above on how to clone a git repository with git software.

  1. Compiling and installing pyBAR
    1. 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 compile and add pyBAR to the Python environment.
      Note: Compiler warnings are expected.
      Windows: If the compilation fails use the Visual Studio Command promt to run the setup script. Because distutils sometimes cannot find VS due to multiple/old VS installation. It might also be necessary to install and activate the 64-bit compiler if you use 64-bit operating system.
       
  2. Installing pyBAR data viewer ViTables 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. Setting up ViTables
      1. If you want to assosiate the .h5 file type with the viewer do:
        1. Windows:
          1. Create a text file ViTables.cmd with the following content
            @echo off
            cls
            start pythonw.exe C:\Miniconda\Scripts\vitables %1

            where C:\Miniconda\ is the installation directory of Miniconda.
          2. Click on a .h5 file and and select in the open with dialog the ViTables.cmd file
        2. Linux:
          1. Right click on a h5 file and select Open with …
          2. Then Custom command —> Browse
          3. Select All Files and choose $HOME/miniconda/bin/vitables
            where $HOME/miniconda is the installation directory of Miniconda.
    2. Setting up the pyBAR Plotting Plug-in
      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