Project

General

Profile

Actions

Windows Installation All » History » Revision 47

« Previous | Revision 47/65 (diff) | Next »
Anchi Cheng, 02/28/2017 09:48 AM


Windows Installation

  • You need to repeat installation of the general packages for each of the computer involved in Leginon operation with addition for the camera and scope.

Install Python and supporting packages with their installers. Only Gatan K2 computer uses 64-bit version of python.

Program package web site local copy of win32 installer local copy of amd64 installer
Python > 2.7.10 http://www.python.org python-2.7.16.msi python-2.7.18.amd64.msi
wxPython 2.8 or newer http://www.wxpython.org wxPython2.8-win32-unicode-2.8.12.1-py27.exe wxPython2.8-win64-unicode-2.8.12.1-py27.exe
MySQL Python client 1.2 or newer http://sourceforge.net/projects/mysql-python MySQL-python-1.2.4b4.win32-py2.7.exe MySQL-python-1.2.3.win-amd64-py2.7.exe
Python Imaging Library (PIL) 1.1.4 or newer http://www.pythonware.com/products/pil/ PIL-1.1.7.win32-py2.7.exe PIL-fork-1.1.7.win-amd64-py2.7.exe
NumPy (use only from our file to match compiled numextension numpy-1.7.0-win32-python2.7.exe numpy-MKL-1.6.2.win-amd64-py2.7.exe
SciPy 0.5.1 or newer http://www.scipy.org scipy-0.11.0-win32-superpack-python2.7.exe scipy-0.11.0.win-amd64-py2.7.exe
Use pyMySQL for leginon 3.6 and above instead of MySQL Python client for both win32 and 64.
pyMySQL 0.10.1 (not higher) https://pypi.org/project/PyMySQL/ pyMySQL-0.10.1-py2.py3-none-any.whl

Excute the installer files and follow the instructions.

Add the IP address and matching hostname of the microscope and digital camera computer in your host file on the main Leginon computer, and vice versa.

Find out what python thinks the hostname is with python command line. REPEAT this both on Linux and Windows PC

Run the following in python command line:

import socket
socket.gethostname()

Find out the ip address associated with the hostname

Run the following in python command line:

import socket
socket.gethostbyname('your_host_name')

Modify your "hosts" file on the linux Leginon computer to include the instrument hosts if the latter is not already mapped by your domain name server

  • On Linux, this "hosts" file is at

/etc/hosts

Example of a "hosts" file:

192.000.1.222   instrument_host_name.domain_name instrument_short_host_name

Use shorter linux hostname if desired

If you'd like to shorten your linux hostname recognized by socket without the domain name, you may do so as root

hostname your_shorter_hostname

and also add that to the /etc/hosts as an alternative name

192.000.1.333   long_host_name.domain_name your_shorter_hostname

You will need to restart networking to make it persistent.

/etc/init.d/network restart

Test the change by finding the ip address with the hostname as in the above section.

The Linux main Leginon computer also needs to identify itself by its hostname registered on the instrument Windows computer.

  • On Window XP and WIndows 7 this host file is

C:\\WINDOWS\system32\drivers\etc\hosts

  • On Window NT, this host file is

C:\\WINNT\system32\drivers\etc\hosts

Install the Windows Installer Files from created from source by NRAMM

Package win32 amd64
numextension numextension-svn.win32-py2.7-numpy1.7.0.exe numextension-svn.win-amd64-py2.7-numpy1.6.2.exe

Execute the installer files and follow the instructions.

Install the packages you downloaded from NRAMM repository

The svn checkout is a folder containing several subpackages. You will install the python packages using python installer. See the next section if you want to use directly the git/svn checkout.

These are the sub-packages

Name: Purpose:
leginon modular TEM image acquisition
pyami general functions
sinedon database interaction
pyscope microscope control and monitoring
imageviewer image viewing for tomography

If you recall Linux processing server installation instruction, this is a bit different. Numextension and LibCV are not included. Numextension is already installed with windows installer. libcv and opencv are not required by Leginon client that this part installation is aimed for.

  • Start a command line Window from Start Menu
  • Install the package in each folder with commands such as
    cd path_to\myami-VERSION\myami\leginon
    c:\\python27\python.exe setup.py install

    Then continue with the other packages, replacing leginon with the package name. See "These are the sub-packages of myami that you will install with the python installer." section above for complete list.

(Alternative approach, easy for updating) Set environment variable PYTHONPATH to use svn check out directly

Set pythonpath environment variable for local myami sandbox

For an uninstall myami svn checkout, you can set PYTHONPATH environment variable to use it directly.

  1. Control Panel\All Control Panel Items\System> click on Advanced settings
  2. System Properties\Advanced> click on Environment Variables
  3. Either create a new variable for the current user, or do it system-widely.

PYTHONPATH should incldue both the base myamipath as well as leginon

For example, myami folder is at C:\Users\vagrant\Desktop\myami, then the python path should be set as follows:

C:\Users\vagrant\Desktop\myami; C:\Users\vagrant\Desktop\myami\leginon


The following depends on what instrument is controlled by the computer

You can also refer to Specific notes for various instrument in Installation_on_the_instrument_computers

Register TecnaiCCD.dll (Gatan 32-bit DM on FEI microscope), CAMC4.exe (For Tietz camera), and adaexp.exe (For film exposure)

  • From the command prompt, run the following commands. You may need to enter the full path of the exe or dll:
    adaexp.exe /regserver
    CAMC4.exe /regserver
    REGSVR32 TecnaiCCD.dll

In one case, we also had to find and register TEM Scripting for an FEI scope

install comtypes if this is for the microscope, or any camera other than Gatan K2 Summit* nor TVIPS.

Program package web site local copy of win32 installer
comtypes 0.6.2 http://sourceforge.net/projects/comtypes" comtypes-0.6.2.win32.exe

Modify comtypes if it is used:

IMPORTANT: After installing comtypes, you must make one modification to it. The module "safearray.py" that comes with comtypes must be replaced with a modified version that we provide. You can find the custom version of safearray.py in the pyscope package. Please copy this module from pyscope into the installed comtypes folder: C:\Python2*\Lib\site-packages\comtypes\. It should replace the safearray.py that is included in comtypes.

Remove safearray.pyc in C:\Python2*\Lib\site-packages\comtypes\ if it does not appear to recompile (timestamp of the file change) when you import comtype in python command line

import comtypes

Run checkcom.py if comtypes is used or run updatecom.py if pywin is used (TIVPS camera)

From a command line window:

cd C:\python27\Lib\site-packages\pyscope
C:\python27\python.exe checkcom.py

or
C:\python27\python.exe updatecom.py

The python window appears should say show the required type libraries it found:

Generating .py files from type libraries...
initializing TEM Scripting
Found TEM Scripting
or
Found Tecnai Scripting
done.

initializing TOM Moniker
Found TOMMoniker 1.0 Type Library
done.

.....

The output depends, of course, on what is available on your microscope/camera computer. For FEI scopes, you should find either "Tecnai Scripting" or "TEM Scripting" and "TOM Moniker". For Tietz camera, you should find 'CAMC4 1.0 Type Library'

You will only find Tecnai Exposure Adaptor (Scripting for film exposure) if you ask FEI for it.

The updatecom.py script should generate a few files in C:\\python27\Lib\win32com\gen_py with seemly scrambled names such as BC0A2B03-19FF-11D3-AE00-00A024CBA50Cx0x1x9.py

Install SEMCCD as Digital Micrograph plugin (Gatan 64-bit computer such as that for K2 camera only)

Thanks to David Mastronarde for providing his DM plug-in using socket connection

Note: If you have SerialEM installed on the same computer, you don't have to go through this. The same Plugin can be used by both programs and share the same port

Remove your older SEMCCDxxxx.dll in C:\Program File\Gatan\Plugins if you had it from prevous leginon-only installtion

Download and extract the files

1. From your browser, go to [[ https://bio3d.colorado.edu/ftp/SerialEM/FrameAlignment/]]
2. Choose Shrmemframe*..exe for your version of DM to download to your Gatan PC.
3. Run the downloaded file and follow its instructions.

Add a new environment variable SERIALEMCCD_PORT if not exist already from SerialEM installation. Set the value to an unused port between 50000 and 60000 to avoid conflict with other programs. Avoid ports used by Leginon, especially not 55555.

Port 50000 or 50001 usually works.

Install Google protobuf (DE camera only)

Protobuf installation instruction

Google Protobuf is an open source communication library DE use between client and server. For C++ programs, it is built into the program, so no external library installation is needed. However, for Python/Leginon only, the library will need to be added. A simple way to install this for python use on DE camera computer (Windows) follows:

  1. Download 2.3.0 source zip file as well as the win32.zip binary file
  2. Unzip both packages.
  3. Copy the binary file protoc-2.3.0-win32/proc.exe into protobuf-2.3.0\protobuf-2.3.0\src folder
  4. Go into protobuf\python and run "python setup.py install".

Note: If it attempts to install 0.6c9 version of setuptools and failed to obtain the file, download the ez_setup.py file from setuptools for Windows 7 at https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py You can then replace the one in your protobuf-2.3.0/python folder.

Register the Tietz ping callback function (Tietz camera only)

  • From a command line window:
cd C:\python27\Lib\site-packages\pyscope
C:\python27\python.exe tietzping.py

camc.ini setup (Tietz camera only)

CAMC4 has its own configuration file "CAMC.ini" that will normally be set up already, but you can search for it on your computer and confirm that everything looks right. It will have configuration parameters for several cameras and only one of them will be activated. The only parameter that may need some adjustment is the readout geometry, which affects the rotation and mirror of the image.


< Package Requirement | Configurations related to Leginon >


Updated by Anchi Cheng almost 8 years ago · 47 revisions