Linux Install

From PyMOLWiki
Revision as of 07:45, 6 November 2011 by Speleo3 (talk | contribs) (lots of outdated, redundant and bloated information)
Jump to navigation Jump to search

This page describes how to install open-source PyMOL on Linux.

Install Distribution-specific binary Package

Many Linux distributions provide binary packages for open-source PyMOL. They often do not provide the latest version, but if the provided package fits your needs this is the most convenient way to install PyMOL.

Command line install examples for some popular distributions:

# Debian/Ubuntu
sudo apt-get install pymol

# Fedora
yum install pymol

# Gentoo
emerge -av pymol

Install from Source

Installation from source gives you the latest version and is the generic way to install PyMOL.

Requirements

Libraries as well as development files (headers) of the following software is required:

  • Python (with distutils)
  • Pmw (Python Megawidgets)
  • OpenGL driver (I use NVidia)
  • libpng
  • freetype

On many Linux systems, one of the following commands installs all requirements:

# Debian/Ubuntu/Mint11
sudo apt-get install subversion build-essential python-dev python-pmw \
  libglew-dev freeglut3-dev libpng-dev libfreetype6-dev

# Fedora
yum install subversion python-devel freeglut-devel freetype-devel tkinter python-pmw

# Gentoo
emerge -av dev-vcs/subversion dev-lang/python dev-python/pmw media-libs/glew \
  media-libs/freeglut media-libs/libpng media-libs/freetype

Get latest Source from SVN

This will download the latest source to /tmp/pymol:

cd /tmp
svn co https://pymol.svn.sourceforge.net/svnroot/pymol/trunk/pymol pymol
cd pymol

Compile and install

This will install PyMOL as normal user into /opt/pymol-svn. If you don't have write permissions to /opt, change the prefix variable to something like $HOME/pymol-svn.

#!/bin/bash -e

prefix=/opt/pymol-svn
modules=$prefix/modules

python setup.py build install \
    --home=$prefix \
    --install-purelib=$modules \
    --install-platlib=$modules

export PYTHONPATH=$modules:$PYTHONPATH
python setup2.py install
install pymol $prefix/

Now launch PyMOL like this (you may copy this launcher into your $PATH, like to /usr/local/bin):

/opt/pymol-svn/pymol

Problems

  • gcc-4.5 is broken for pymol install, use gcc-4.4 (Mint11 Linux, PyMOL 1.4.1, reported by User:Tlinnet)
  • If you get an error message "ImportError: No module named Pmw" and lack half of the user interface, then run the additional command
python setup2.py install pmw
to install a copy of the Python MegaWidgets.