Difference between revisions of "Linux Install"

From PyMOLWiki
Jump to: navigation, search
(From Source)
Line 24: Line 24:
Now, just remove the '''pymol_temp''' directory if you want and you're done.
Now, just remove the '''pymol_temp''' directory if you want and you're done.
=== From Source ===
=== From Source ===
* Assuming that you're running under Linux, you'll need the following dependencies installed first:
* Under modern Linux, you will need the dependencies installed first (requires root).
python-devel, libpng-devel,
** <source lang="python">Fedora9% yum install python-devel tkinter libpng-devel freeglut-devel freetype-devel</source>
* untar the compressed package;
* untar the compressed package;
* cd into the newly untarred directory (should be '''pymol''' or '''pymol-version''').
* cd into the newly untarred directory (should be '''pymol''' or '''pymol-version''').
* execute <source lang="python">python setup.py install            # you may need to be root</source>
* execute <source lang="python">python setup.py install            # you may need to be root</source>
* execute <source lang="python">python setup2.py install           # you may need to be root</source>
* execute <source lang="python">python setup2.py install         # you may need to be root</source>
* execute <source lang="python">cp ./pymol SOME_PATH          # where SOME_PATH is some directory in your $PATH</source>
* execute <source lang="python">cp ./pymol SOME_PATH          # where SOME_PATH is some directory in your $PATH</source>
The executable name is "pymol".
The executable name is "pymol".

Revision as of 18:08, 28 October 2008

Installing PyMol is quite straightforward.


Installing PyMol is very simple, even from source. On Linux, you need the following requirements:

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

Generic Linux

Quick Install for Latest Features

Many people want the latest versions of PyMOL as they usually have valuable features, but don't want to build PyMOL. Building PyMOL is generally very simple.

This quick install assumes you already have a Subversion client installed, have some sort of superuser (root) access, and have internet access. It will download the most current version from PyMOL's Projet Page and install it. This should install PyMOL onto your system so that any users on your system can use it. To easily get the latest version, do the following:

mkdir pymol_temp
cd pymol_temp
svn co https://pymol.svn.sourceforge.net/svnroot/pymol/trunk/pymol pymol
cd pymol
sudo python setup.py install
sudo python setup2.py install
sudo cp ./pymol /usr/local/bin/pymol

Now, just remove the pymol_temp directory if you want and you're done.

From Source

  • Under modern Linux, you will need the dependencies installed first (requires root).
    • Fedora9% yum install python-devel tkinter libpng-devel freeglut-devel freetype-devel
  • untar the compressed package;
  • cd into the newly untarred directory (should be pymol or pymol-version).
  • execute
    python setup.py install            # you may need to be root
  • execute
    python setup2.py install          # you may need to be root
  • execute
    cp ./pymol SOME_PATH           # where SOME_PATH is some directory in your $PATH

The executable name is "pymol".

From Package

Download the appropriate RPM and use 'rpm' to install it. Typically,

rpm -Uvh rpmFileName.rpm

Compiling By Hand

Due to the large variance of Linux systems, some systems may work fine with PyMol, and some may have related install issues. To overcome this, you can download the ext package and the PyMol source and compile/install by hand. The ext package is available from the Source Forge download section and contains all the necessary software to make PyMol run. In the most recent available version (0.99rc1) this includes

  • tcl-8_4_11.tgz
  • tk-8_4_11.tgz
  • zlib-1_2_3.tgz
  • libpng-1_2_8.tgz
  • python-2_4_2.tgz
  • numeric-24_2.tgz
  • pmw-1_2.tgz
  • freetype-2_1_10.tgz


  • (freeglut-2_4_0.tgz


  • glut-3_7_6.tgz)

Supported Packages

The above packages don't need to be installed from their source-packages only. That is, you can use your system's installer (eg. yum, YaST, apt-get, rpm, etc.) to install the packages. Just be sure, if you install the above packages with your system's installer, that you also include the development packages. PyMOL needs the source/header files to compile against. For example, don't only install, freeglut-2.4.0 but also look for, and install, freeglut-2.4.-devel .

Once downloaded, see the file pymol/INSTALL and pymol/INSTALL.generic.

Here's the basic steps to install by source:

  1. get the source PyMol Source
  2. extract both packages, rename ext-VERSION.tgz to ext and move it into the pymol directory
  3. cd pymol
  4. cd ext
  5. vi build.com # edit the build file
  6. cd ..
  7. cp setup/Rules.make . # or correct Rules.make file for your machine
  8. vi Rules.make # make appropriate changes
  9. vi setup.py # make appropriate changes
  10. make


  • if you're using a 64-bit machine, lib becomes lib64 for almost everything
  • ensure you have the correct Python path and version (is it 2.3? 2.4?)
  • make sure you make the changes in Rules.make, setup.py, and Makefile, for your platform. For x86_64, besides above files, change following line in contrib/modules/Makefile.pre.in.src pointing to lib64 (leafyoung at yahoo dot com)
  LIBP=           $(exec_installdir)/lib64/python$(VERSION)

Copy the appropriate setup/Rules.XXX file to the base PyMol dir. You'll have to edit the file for your system. Then run 'make'.

Installing without Superuser (root) Privileges

Use the prefix command to specify where to install PyMOL. Then, you'll need to modify your PYTHONPATH variable,

1 # install to prefix
2 python setup.py install --prefix /dir_to/pymol/py_build
3 # update your PYTHONPATH variable
4 export PYTHONPATH=$PYTHONPATH:/dir_to/pymol/py_build/lib/python{version}/site-packages
5 # install to prefix (this step _is_ needed)
6 python setup2.py install --prefix /dir_to/pymol/py_build
7 # now you can run PyMOL
8 ./pymol

Installing a Script Without Superuser Access

Install the script following the instructions by the distributor. Then, add the path where the module was built to the PYTHONPATH environment variable (if needed).

Fedora Core Linux (x86)

PyMOL RPMs are available for Fedora Core 1 & 2, provided by Morten Kjeldgaard. These can be manually downloaded by browsing from: [1]

Alternatively, PyMOL can be installed using Yum (an automated package installer and updater, installed by default in Fedora). This can be done by adding the following lines to your /etc/yum.conf file:

name=MOKs RPM Repository fedora $releasever - $basearch - xray

you may also need to add the pgp key for the repository before yum will get packages from it by either saying:

rpm --import http://www.bioxray.dk/~mok/404825e7.asc

or with older versions of rpm:

wget http://www.bioxray.dk/~mok/404825e7.asc
rpm --import 404825e7.asc

And then issuing the following command as root:

yum install pymol

Gentoo Linux (x86)

as root:

emerge pymol

be sure to have the proper OpenGL configuration. For example:

opengl-update ati
opengl-update nvidia

list of available versions in portage pymol for gentoo

A version of the latest svn build is avaible via the dberkholz overlay, which can be used with

layman -a dberkholz && emerge =sci-chemistry/pymol-9999

There is ongoing development in providing plugins via ebuilds with an thread in gentoo bugzilla. The ebuild can be checked out via svn

svn co http://svn.olausson.de/molmod/trunk

There is also svn ebuild of pymol, which contains all bugfixes which are request in the gentoo bugzilla.

All bugs and feature request should be either send to justin at j-schmitz dot net or spamsuxx at gmail dot com.


32-bit (x86)

See #Generic Linux above.

64-bit (x86_64)

See #Generic Linux above. Some details for problem solving are here. 64-bit Python install is quite easy. Make sure your nvidia driver is installed (or ATI, but I have no experience there).

To install PyMol

  • Ensure your system has it's distutils in place and ready to use. Try the following check:
from distutils import *
  • Download the source
  • Download Pmw from SourceForge.
    • To install Pmw, just decompress it and then move the base director "Pwm" to /usr/lib64/python2.3/site-packages/. You can test that it's there by testing the import, see below:
import * from Pmw

If errors erupt, investigate.

  • decompress the source and cd into the PyMol directory that was just decompressed.
  • If upgrading see below.
  • Now enter the following...

python setup.py build
sudo python setup.py install
sudo python setup2.py

  • The sudo commands will need a root password or someone with sudo capabilities.

I also copy the 'pymol.com' file to /usr/local/bin or /usr/bin -- somewhere in my path:

sudo cp ./pymol.com /usr/local/bin

Please note that newer versions of PyMol create the pymol executable, not pymol.com. So, for later versions (~0.99+) use

sudo cp ./pymol /usr/local/bin

You should now have a working PyMol install.

pymol.com should now run your new PyMol install.

Ubuntu Linux (x86 32,64; mac ppc)


The Ubuntu pymol package can be installed with minimal effort using the GUI package manager synaptic, or on the command line, using the command

sudo apt-get install pymol

once the universe repository has been activated.

Ubuntu is a completely free and well-maintained Debian GNU/Linux distribution. Further details on using Ubuntu for crystallography and related applications are available are linked. PyMol also compiles from source on Ubuntu following the #Generic Linux instructions given above.

NOTE : If you experience problems with PyMOL OpenGL window (i.e. flickering) try disabling compiz.

Preparing your System

See Linux_XFree86_Configuration.


XFree86 Config

Check out Configuring XFree86 if you need information on editing the XFree86 configuration file.


Adding a

Stereo 3

option in /etc/X11/xorg.conf suffices to run pymol in stereo mode on a 64bit system with the Nvidia Quadro FX1400 under Red Hat Enterprise 4 (RHEL4). Adding the following modeline (determined via /usr/bin/gtf):

ModeLine     "1280x1024_118.00" 229.7 1280 1384 1528 1776 1024 1025 1028 1096 -hsync +vsync

appears to slightly improve the stereo quality, in particular when one displays labels and/or dashes/dots.

For those having possible driver issues, this link might help NVNews

xorg.conf for stereo in Fedora Core 6

It is assumed that you have installed the proprietary Nvidia graphics drivers, and that the "Device" section of xorg.conf has the following line in it:

Driver "nvidia"

Add the following section to the end of xorg.conf to disable "Composite", which is incompatible with stereographics.

Section "Extensions"
     Option "Composite" "Disable"

In Section "Screen" add the following line to enable quad-buffered stereo:

Option "Stereo" "3"



If you notice that the keyboard input is ignored into the Pmw widgets, you may have an X-based input method editor installed and running. Such examples could be SCIM, KINPUT/2 or the like. Try turning off the IME and restarting PyMol to get the widgets to recognize your input.

libnvidia-tls.so.1: cannot handle TLS data

If you get an error, upon invoking pymol, of the form

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/pymol/__init__.py", line 109, in ?
    import pymol
  File "/usr/lib/python2.4/site-packages/pymol/__init__.py", line 353, in ?
    import _cmd
ImportError: libnvidia-tls.so.1: cannot handle TLS data

then try changing the permissons on libnvidia-tls.so.1. i.e,

 sudo chmod 777 /usr/lib/libnvidia-tls.so.1   

Super-Large Files

For loading files that require the majority of your system's memory, try tweaking your system's ulimit before starting PyMOL. Be warned, when your system uses its full amount of memory and swap space, it comes to a halt very quickly.

# shows current setup
ulimit -a

# allows setting of a limit in current shell.
ulimit -v SizeInKB