Binary Installation Instructions v2.9



MacOS and Linux

The neural network code in EMAN2 works best on GPUs, which are available only on the Linux installations. It can still run on Mac, but will be quite slow.

  1. Cleanup: If you have previously installed EMAN2:

    • Please remove or rename any existing installed EMAN2 folder you might have.
    • Please remove any existing EMAN2 entries from PATH.
    • LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, PYTHONPATH and PYTHONHOME are NO LONGER USED, and should be removed if you have them set.
    • If you have any of these shell variables set for use with other software, it may be necessary to remove those settings as well. If the tests below fail after installation, this is the first thing to check.
  2. Download: Linux / Mac binary.

  3. Install:

       1 bash <path-to-EMAN2-installer>
    • You will be prompted for a location to install EMAN2. Note that you cannot rename this folder after installation! You must reinstall if you wish to move the installation.
    • You will be asked if you want to initialize EMAN2.
    • EMAN2 initialization will add a block of code to your .profile/.bashrc file. After initialization open your .profile/.bashrc file and confirm that a block like the following has been added

         1 # added by EMAN2 2.9 installer
         2 # >>> conda init >>>
         3 # !! Contents within this block are managed by 'conda init' !!
         4 ...
         5 ...
         6 ...
         7 unset __conda_setup
         8 # <<< conda init <<<
      If you have any other similar looking blocks before the last one, remove them to avoid any potential conflicts.
    • If you use a different shell, such as tcsh or zsh, you may need to edit the appropriate file yourself.
    • You should not normally need to reinstall OpenMPI. The copy of OpenMPI/Pydusa now distributed with the binaries should work on Macs/Linux workstations in most cases.
    • Don't forget to restart your shell if you changed the .profile/.bashrc or other scripts.
    • Mac users: If you don't understand what the .profile instructions are talking about, this may help:

  4. Test: Run these programs to see if the install worked:

       4 :64:64:1 test.hdf --process
       5 test.hdf


  1. Linux users: The new neural network based routines are much faster running on a GPU. If you have an NVidia graphics card, see ''Using the GPU'' section below.

  2. Mac users (Big Sur): Big Sur (MacOS 11) includes new security features which require you to give software permission to access specific folders. This can cause problems for many open-source software packages launched from the command line. The easiest solution is Preferences -> Security & Privacy -> Privacy -> Full Disk Access, and give Terminal full access. This will not solve every problem, and you need to be aware of potential security risks in doing this, but for most scientific users it is a good solution.

  3. Mac users (Apple Silicon, M1): Anaconda does not yet fully support native M1 software, so you will need to install the normal Mac build. The installer will say that you appear not to be running on a 64 bit machine, and ask if you wish to install anyway. Say YES. Performance is excellent even though it isn't a native build.

Troubleshooting and Tips

  1. If you have problems with any of these programs, the first thing to check is whether you have PYTHONPATH, PYTHONHOME, LD_LIBRARY_PATH or DYLD_LIBRARY_PATH set in your shell. While used in previous versions of EMAN, variables are no longer used, and in some cases may interfere with Anaconda. If they are set to make some other software package work, but they interfere with the programs above, you will have to unset them, and set them only when you need the other software.
  2. Specifically, if only the last command fails and you are using an Nvidia graphics card, it is likely caused by a graphics card driver incompatibility. Updating the Nvidia driver usually fixes the problem. On recent Ubuntu systems, running apt-get install nvidia-current works. On other systems, you may need to follow the installation guide from Nvidia.

  3. You will find that when you open a new shell, you will see (base) added to your command prompt. This indicates that Anaconda, the environment EMAN2 now uses for distribution, is active, and you can run EMAN2/SPARX/SPHIRE commands.
    • If this causes issues for other software, you can type conda deactivate and EMAN2 commands will no longer work (but any software that doesn't like Anaconda will work).

    • Alternatively, you can type conda config --set auto_activate_base False, which will prevent Anaconda from being activated automatically when you open new shells. In that case you will need to do a conda activate before running EMAN2/SPARX/SPHIRE commands.


We provide 64 bit Windows binaries for EMAN2, however, please see the #Windows-WSL option below for what may be a better alternative. Notes:

Native Win7/10 64 bit

  1. Download eman2.9_sphire1.4_sparx.win64.exe.

  2. Launch the installer.
    1. Select Installation Type: Just Me

    2. Choose Installation Location: Select a location with NO space in path

    3. Advanced Installation Options: Don't add EMAN2 to PATH environment variable.

  3. Open Anaconda Prompt by clicking Windows Start Menu -> Anaconda3 (64-bit) -> Anaconda Prompt or Start Menu -> Anaconda3 (64-bit) -> Anaconda Prompt(installation-folder-name).

  4. In most cases you will want to install: Python Launcher (launchwin-

  5. Run these programs to see if the install worked: :64:64:1 test.hdf --process

Windows 10 - Linux/Bash shell (As of 12/15/2020)

Windows 10 includes an embedded Ubuntu Linux environment. It is possible to run the EMAN2 Linux binaries within this Win10 environment, but you will need to install some additional dependencies to do so. Also, you will effectively be running at a Linux command prompt, so you will have to become a bit familiar with Linux to do this, but it does avoid installing an additional operating system on your machine.

  1. Click "Start" and type "Turn Windows Features on or off".
    • Enable "Windows Subsystem for Linux".
    • Enable "Virtual Machine Platform".

    Windows Features.png

  2. Install Ubuntu from "Microsoft Store".

    Windows Store - Ubuntu.png

  3. Run "Ubuntu" from Start Menu.
  4. Install OpenGL.
       1 sudo apt update
       2 sudo apt install libsm-dev libxrender-dev build-essential libgl1-mesa-dev mesa-utils mesa-common-dev libglu1-mesa libglu1-mesa-dev mesa-utils
       3 sudo apt autoremove
  5. Install Xming X Server for Windows.

    • Don't forget the fonts and Mesa (OpenGL) modules! If it seems to work, but the letters are black boxes, or you have other visual artifacts, the problem is probably with OpenGL support.
  6. Download and install, #Linux.

    Make sure to follow the instructions for shell initialization using conda-init.

  7. Start X Server and set environment variables.
       1 export DISPLAY=:0
       2 glxinfo | grep OpenGL

    OpenGL output.png

  8. Run these programs to see if the install worked:
       4 :64:64:1 test.hdf --process

    Windows e2display.png

Using the GPU (Linux only)

Currently, the GPU is only used for neural network operations in tomogram annotation and in particle picking. It provides a ~10 fold or more speed up in neural network training. The new GPU developments are currently based on TensorFlow. From about 2006-2012 EMAN2 had its own internal CUDA code, which could be compiled into the C++ library. This has been deprecated, and likely no longer works, though the code is still present. We are working on a new GPU support strategy moving forward.

Many machines will have CUDA installed already, and if CUDA is an appropriate version, this should work fine with the TensorFlow version shipped with EMAN2. However, if you are running newer versions of CUDA there may be problems. You can test compatibility quickly with:

# Make sure you have your environment set to run EMAN2 programs
# The above command should work and return your current version. If it does, then run:
python -c "import tensorflow"

If this command does not return an error, then you should be able to run deep learning software within EMAN2. If it does raise an error, then you will need to debug the problem:

EMAN2/Install/BinaryInstallAnaconda/2.9 (last edited 2021-02-13 20:57:19 by TunayDurmaz)