-
Notifications
You must be signed in to change notification settings - Fork 17
Step by step Installation Guide
D.-L.Pohl edited this page Feb 2, 2016
·
40 revisions
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.
-
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.
-
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
-
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.- 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.
- Download the Eclipse installer from Eclipse Homepage and choose Eclipse for C/C++ developers during installation.
- Eclipse asks for a workspace path where the projects will be located on your harddrive. Standard settings are sufficient.
- Close the welcome screen.
- 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 withsudo update-alternatives --config java
- Add PyDev perspective to Eclipse and select it. The button is located in the upper rigth corner:

- 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.
-
Installing Required Packages
- 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]
- 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. - 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:- 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
Or a branch:
git ckeckout -b tag_name tag_name
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). - 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.
- Clone the repository.
- Installing Python Packages
-
Cloning pyBAR
- In Eclipse, goto File→Import→Git and select Projects from Git
- Click clone URI and type the pyBAR repository (URI: https://github.com/SiLab-Bonn/pyBAR)
- If you have a GitHub account you can add the credentials here
- Click next, select all branches, click next and specify the directory where pyBAR will be cloned to
- 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
- Wait until the download of the code is finished and check Check out as project configured using the New Project Wizard
- Select PyDev → PyDevProject
- 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.
-
Compiling and 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 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.
- 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:
-
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.- Setting up ViTables
- If you want to assosiate the .h5 file type with the viewer do:
-
Windows:
- 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. - Click on a .h5 file and and select in the open with dialog the ViTables.cmd file
- Create a text file ViTables.cmd with the following content
-
Linux:
- Right click on a h5 file and select Open with …
- Then Custom command —> Browse
- Select All Files and choose $HOME/miniconda/bin/vitables
where $HOME/miniconda is the installation directory of Miniconda.
-
Windows:
- If you want to assosiate the .h5 file type with the viewer do:
- Setting up the pyBAR Plotting Plug-in
- Open ViTables and go to Settings→Preferences→Plugins and add the pyBAR plugin folder via pressing New:

- Restart ViTables and add the pybar_vitables_plugin in the same settings dialog:

- 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.
- Open ViTables and go to Settings→Preferences→Plugins and add the pyBAR plugin folder via pressing New:
- Setting up ViTables