Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name


Develop Environment




Before you start programming


The 'SPARX' packages are installed under a user-chosen directory. Installation from source is fully compatible with your system. After download the source, the steps are

   tar zxvf sparx-installer.tar.gz
   cd sparx-installer

The installer does not touch anything outside those two directories, and it works on any linux system. For further question, click HowToInstall or email to mhhohn@lbl.gov .

To update, upload, and remove individual parts

Update for sparx and EMAN2

   cd ~/sparx
   cvs up -dP
   cd ~/sparx/libpy
   cvs up -dP

   cd ~/EMAN2/src/eman2
   cvs up -dP
   cd ~/EMAN2/src/build
   cmake ../eman2
   make && make install

Upload individual parts to CVS

   cvs add filename.py
   cvs ci filename.py 

Remove individual parts to CVS

   rm /user/home/sparx/bin/filename.py 
   cvs remove filename.py
   cvs ci filename.py 

To run Python program

There are two ways to start running Pyton code. First, you can simply type the command on the window sparx and it allows your computer start the sparx console. To use SPARX library, you need to import fuctions first.

   In [1]: from sparx import *

If you want to test one specific function, for example info, in applications.py located in /user/home/sparx/lipbin, then you type on the console like below,

   In [2]: from applications import info
   In [3]: info(''file or parameter name'')

Of course, you don't want to type every single line command on the console. To make an excute pyton file, we need to put below code inside of the file. Make sure that your_python_program has to be same as the file name.

   #! /usr/bin/env python
   import os from EMAN2 
   import * from sparx 
   from optparse import OptionParser import sys
   from your_python_file import your_python_program

   def main():
       # This example recieve one string and one number as input
       progname = os.path.basename(sys.argv[0]) usage = progname + "--num = number"
       parser = OptionParser(usage,version=SPARXVERSION) 
       parser.add_option("num", type="float",default=1, help="  ")
       (options, args) = parser.parse_args() 

   if __name__ == "__main__":

Once you have an excute *.py file, you need to give it a permision on the Unix terminal.

   chmod u+x 
   source usr/.cshrc