Installation instructions - syue99/Lab_control GitHub Wiki

Installation

Windows OS

In this section, we will talk about how to install the required environment of the vers.0.0 labrad on a Windows 10 computer. Let's assume you start with an empty computer. The following steps take credits from Prof. Jayich's group at UCSB.

Step1: Initial set-up

For installing Windows, you can get an installation disc from the PCS, or use Windows install media tool to create a USB windows install drive (Select Windows 10 Pro or Windows 10 Education for 64 bit). Talk with Raj to get buy a key or talk with Fred to get a spare key.

You can name the PC labuser with password funinthelab. This is our default set up.

Disable sleep or hibernate on the computer if it will be used to control instruments. Allow remote desktop into the computer. Also consider disabling the windows update using the group policy editer because it causes unexpected restarts (even during experiments!).

Download and install Google Chrome, 7-zip, and your favorite text editor.

Step2: get Code and Git repos

Under the labuser folder (Usually in C:\Users\labuser), create a folder called code.

Download Github Desktop, log into our github group, in configure Git page enter your Github username and email, and you should be able to clone the following repositories to the local computer in the code folder just created:

Step3: Install Python and related packages

  • You can just copy the environment backup from our lab NAS system if you want a running system quick. But otherwise, you can follow the steps below.
  • Download Anaconda3, and install it. During the install, make sure that the option to Add Anaconda to my PATH environment variable is checked, and it is installed in the user folder (C:\Users\scientist\Anaconda3).
  • Download Build Tools for Visual Studio 2019, and install it with only all components in Visual C++ (including the Windows SDK).
  • After installation, create a new python 3.6 environment in Anaconda3 called "code3". This can be done in Anaconda Navigator or via the command line. tutorial for details. Or you can type conda create -n code3 python=3.6 in anaconda prompt
  • Open cmd and run activate code3.
  • Run pip install pylabrad spinmob pycodestyle nose pyqt5 pyqtgraph pywin32 ok ipython matplotlib scipy numpy qt5reactor jupyter treedict==0.2.2 pyserial pyvisa sympy mcculw coverage Cython statsmodels pillow.
  • Run pip install qutip tables.
  • You will need to change directory to C:\Users\labuser\Anaconda3\envs\code3\Lib\site-packages\ok and change all the files there with all files in ok_backup from the environment branch (will set up later) or back_up packages in the lab NAS system.
  • You will also need to install pyqt4 related packages if you want to run any file in the pyqt4-client. You will need to get a pyqt4 wheel file from the environment branch/backup. You will need to pip install /directory/to/whl/file and continue if there isn't any error message. You will also need to run pip install qt4reactor and then change the file there with all files in qt4reactor from the environment branch/backup. (Also you might need a sip.pyd and sipconfig.py file in the C:\Users\labuser\Anaconda3\envs\code3\Lib\site-packages dirc if you find an error message of not finding sip when running Pyqt4 related packages.)
  • You can check the env.png to check the package versions of a running system and compare it with your end if you had any trouble running some codes due to the environment. Also, you can just copy the environment backup from our lab NAS system if you want a running system quickly.

Step4: Finalize and run LabRAD Manager

  • Install Java if not already installed. Current version of 2018/11/10 is Java 8 update 191. JDK (Java Development Kit) is not needed if you wonder about it.
  • Install Chromium (blue chrome) Install the Chromium from the environment branch/set-up. This is a version of old chrome that support the front-end of labrad (scalabrad_web) of current version(2.0.6). Normal browser can be used if the new version fix the compatability issue.
  • Run labrad manager and front-end by running the scalabrad.bat and scalabradweb.bat from the corresponding folders (in this repo). If there isn't any error message, open the chromium and try to access localhost:7667. Otherwise, look for the error message, which possibly is due to a wrong directory address leading to an non-exisiting Java folder. Try to fix the issue by reset the address in the bat file.
  • Run datavault.py, paravault.py, pulser.py.. by opening a new anaconda prompt and activate to code3 enviroment by running conda activate code3 first and then python \directory\to\file. You should be good to go. Note that you might need to change configuration file in the config folder for pulser if you are connecting a new fpga. Some more detailed explanation of every module will be discussed in other pages in the documentaion. PS: The parameter vault function is not well written, so when we first run it, you have to create a folder "Parameter Vault" in the regsitry(Chromium) and then run it. After that it is always good to go. I will try to find some spare time to fix this in the code. For the pulser, you need to instsall the Frontpanel api so that you have the usb driver. The Frontpanel should aslo be in the NAS system

Linux based system

Follow most of the Step2-4. Note in linux-based system, PATH-TO/scalabrad-0.5.0/bin/labrad starts the labrad server scalabrad-web-server-2.0.6/bin/labrad-web starts the labrad web interface which can be accessed at localhost:7667. And that a version of chrome<80 is required to run the current implementation of scalabrad-web.

The original installation guide provided by AMOLabRAD (Fred deleted irrelevant info)

Note some of the info in it is quite outdated. But some of the tips might be useful when installing

Install and Configure LabRAD Manager, Install Registry Editor

Original Info is not useful as LabRAD Manager and Registry has been replaced by Scalabrad and Scalabrad_Web. Don't buy a word from soureforge. Check out the links to find more.

Install pylabrad

Installation

We use pylabrad in order to write servers and clients in python. The instructions on how to install pylabrad are available on all of the platforms:

First connection

To print out some basic information about the installation, do:

import labrad
print (labrad.__version__, labrad.__revision__, labrad.__date__)

Note: this prints out the information about the changes of the __init__.py file, which may not be updated if a different file was modified.

Make the first connection. With the Manager running execute:

import labrad
with labrad.connect() as cxn:
    print cxn

Printing the connection object should give the list of running LabRAD servers.

Additional Tips

  • Ipython shell provides tab completion for LabRAD servers and server settings. On Windows pyreadline package is required.

##Environmental Variables

We can set environmental variables to specify how to connect to the Manager.

  • LABRADHOST specifies the address of the LabRAD Manager so that local servers and clients know where to connect. It may either be localhost if the Manager is running on the same machine, or the ip address of the computer where the manager is running.
  • LABRADPASSWORD specifies the password to avoid retyping it every time we connect to the Manager.
  • LABRADNODE is the meaningful name of the current machine, which will be seen by the Manager. The port can also be specified with LABRADPORT, but we only use the default. Changing the port will break Delphi-based Registry Editor.

Windows 7

Navigate to Control Panel\System and Security\System. Then add the variables with Advanced system settings->Environment variables

Ubuntu

These variables are added to /etc/environment/ to make them global or to ~/.pam_environment to make them specific to a given user. You may need to restart for these changes to take effect.

Mac OS X 10.8 Mountain Lion

These variables are added to /etc/launchd.conf in the form

setenv NAME VALUE

Back to Main Wiki