Installing and running khmer

You'll need a 64-bit operating system, internet access, and Python 2.7.x OR Python 3.3 or greater.

If you are running khmer in a HPC environment or for other reasons do not have root access try creating a virtual environment as described in the OS X instructions below (even if you are on linux) and then installing khmer in that newly created virtual environment.

Build requirements


  1. From a terminal download the virtualenv package and create a virtual environment with it:

    curl -O
    tar xzf virtualenv*
    cd virtualenv-*; python2.7 ../khmerEnv; cd ..
    source khmerEnv/bin/activate
  2. Go to Installing khmer inside the virtualenv to install khmer itself.


  1. Install the python development environment, virtualenv, pip, gcc, and g++.

    • On recent Debian and Ubuntu this can be done with:

      sudo apt-get install python2.7-dev python-virtualenv python-pip gcc \
    • For RHEL6:

      sudo yum install -y python-devel python-pip git gcc gcc-c++ make
      sudo pip install virtualenv
  2. Create a virtualenv and activate it:

    cd a/writable/directory/
    python2.7 -m virtualenv khmerEnv
    source khmerEnv/bin/activate

    Linux users without root access can try the OS X instructions above.

Installing khmer inside the virtualenv

  1. Use pip to download, build, and install khmer and its dependencies:

    pip2 install khmer
  2. The scripts are now in the env/bin directory and ready for your use. You can directly use them by name, see khmer's command-line interface.

  3. When returning to khmer after installing it you will need to reactivate the virtualenv first:

    source khmerEnv/bin/activate
comments powered by Disqus