-
Notifications
You must be signed in to change notification settings - Fork 1
Installation pylabrad Kubuntu 12.04
In general, virtualenv and virtualenvwrapper python packages provide a good way to maintain and version-control all the python libraries. The basic idea is that one creates a virtual environment where libraries are installed and maintained. In the virtual environment, libraries don't auto-update and are isolated from the system libraries. This is particularly important in Kubuntu given the system's use of PyQt.This reference provides a good guide to using virtual environments with the virtualenvwrapper class, simplifying the usage.
Kubuntu 12.04 comes with Python 2.7.3 we will use it to create virtual environment. First, install pip:
sudo apt-get install python-pip python-dev build-essential
Then update pip and install virtual environment:
sudo pip install --upgrade pip
sudo pip install virtualenv virtualenvwrapper
Start using the virtual environment. To make permanent add this command to /etc/bash.bashrc or ~/.bashrc
source virtualenvwrapper.sh
Then make a new virtual env
mkvirtualenv labrad
There are three ways to install pylabrad described in the subsections below.
first get twisted
pip install twistedthen get labrad
the link is here https://github.com/martinisgroup/pylabrad , clone the repository then cd in the folder type:
python setup.py install
This is the easiest way but may not provide the latest bug-fixes.
workon labrad
pip install twisted
pip install pylabrad
Gets the latest source code
workon labrad
pip install twisted
cd ~/Downloads
sudo apt-get install subversion -y
svn co https://svn.code.sf.net/p/pylabrad/svn/trunk pylabrad
cd pylabrad
python setup.py installIn addition to the basic pylabrad installation, the user may want to install scientific processing or graphical python libraries, or drivers. Keep in mind these have to be installed in the virtual environment.
pip install numpy
sudo apt-get install libpng12-dev libjpeg8-dev libfreetype6-dev
pip install matplotlib
alternatively aptitude may be better (this had better luck recently)
sudo apt-get install python-matplotlib
Edit configuration file found with
workon labrad
python
import matplotlib
print matplotlib.matplotlib_fname()
to state:
backend : Qt4Agg
sudo apt-get install libatlas-base-dev gfortran
pip install scipy
or aptitude
sudo apt-get install python-scipy
pip install pyserial
pip install bitarray ipython psutil treedict
pip install cython
Download the latest qutip installation and run:
python setup.py install
pip install treedict
treedict can also be installed with
sudo easy_install treedict
PyQt is needed for development and execution of graphical applications. To install, one needs to first build SIP. Download SIP 4.14.7 (at the time of writing this) from http://www.riverbankcomputing.com/software/sip/download.
To install SIP:
sudo apt-get install g++ byacc flex
workon labrad
python configure.py
make
sudo make installDownload the latest PyQt version (4.10.2 at the time of writing this) from http://www.riverbankcomputing.co.uk/software/pyqt/download
To install PyQt:
sudo apt-get install qt4-dev-tools libxext-dev libxext6 qt4-designer
workon labrad
python configure.py
make
sudo make install- If you see an error about sipconfig, make sure that sipconfig.py in site-packages has the right ownership.
First, copy and extract the FrontPanelUSB-FC15-64-4.0.3.tgz from the CD that came with the FPGA (use the 32 bit version if appropriate):
tar -xvzf FrontPanelUSB-FC15-64-4.0.3.tgz
Now we will follow a Ubuntu-adapted version of install.sh:
cp ./60-opalkelly.rules /etc/udev/rules.d
cp API/libokFrontPanel.so /usr/local/lib/
cp -r API/okFrontPanelDLL.* /usr/local/include/
Then reboot and copy the files in API/Python/ to the ok subfolder of the site-packages folder of the virtual environment.
It is convenient to make a desktop launch for example, to launch the the node server. To do that, first make a bash script startNodeServer.sh as follows:
#!/bin/bash
source virtualenvwrapper.sh
workon 'labrad'
twistd -n labradnode
exit 0and then make a desktop launcher with the command. The -i option is necessary for the script to be aware of the standard environmental variables.
bash -i /some_path/startNodeServer.sh