This is a read-only mirror of pymolwiki.org

Difference between revisions of "Linux Install"

From PyMOL Wiki
Jump to navigation Jump to search
(lots of outdated, redundant and bloated information)
Line 1: Line 1:
Installing PyMol is quite straightforward.
+
This page describes how to install open-source PyMOL on Linux.
  
=PyMol=
+
== Install Distribution-specific binary Package ==
Installing PyMol is very simple, even from source.  On Linux, you need the following requirements:
 
* [http://www.python.org/ Python] (with distutils)
 
* [http://pmw.sf.net Pmw] (Python Megawidgets)
 
* OpenGL driver (I use [http://www.nvidia.com/object/unix.html NVidia])
 
* libpng
 
  
== Generic Linux ==
+
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.
  
=== From Source ===
+
Command line install examples for some popular distributions:
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 [http://subversion.tigris.org/ Subversion] client installed, have internet access, and all the dependencies are satisfied.
 
 
 
To obtain a copy of the current revision version issue the command:
 
  
 
<source lang="bash">
 
<source lang="bash">
svn co https://pymol.svn.sourceforge.net/svnroot/pymol/trunk/pymol pymol
+
# Debian/Ubuntu
</source>
+
sudo apt-get install pymol
  
Then go into the source directory:
+
# Fedora
 +
yum install pymol
  
<source lang="bash">
+
# Gentoo
cd pymol
+
emerge -av pymol
 
</source>
 
</source>
  
If you have root or superuser privileges you can continue with the installation. If not follow [http://pymolwiki.org/index.php/Linux_Install#Installing_without_root_Privileges this guide]
+
== Install from Source ==
  
Run the first stage of the installation:
+
Installation from source gives you the latest version and is the generic way to install PyMOL.
  
<source lang="bash">
+
=== Requirements ===
python setup.py install
 
</source>
 
  
Run the second stage of the installation:
+
Libraries as well as development files (headers) of the following software is
<source lang="bash">
+
required:
python setup2.py install
 
</source>
 
  
A launch script '''pymol''' will have been created. You can copy this script in the /usr/local/bin directory, so that any user of the system can use PyMOL:
+
* [http://www.python.org/ Python] (with distutils)
 
+
* [http://pmw.sf.net Pmw] (Python Megawidgets)
<source lang="bash">
+
* OpenGL driver (I use [http://www.nvidia.com/object/unix.html NVidia])
cp ./pymol /usr/local/bin
+
* libpng
</source>
+
* freetype
 
 
Test your installation. If you get an error message "ImportError: No module named Pmw" and lack half of the user interface, then run the additional command:
 
 
 
<source lang="bash">
 
python setup2.py install pmw
 
</source>
 
  
If you want to update the source code to the latest svn revision, go into the pymol directory and issue the command:
+
On many Linux systems, one of the following commands installs all requirements:
  
 
<source lang="bash">
 
<source lang="bash">
svn up
+
# Debian/Ubuntu/Mint11
</source>
+
sudo apt-get install subversion build-essential python-dev python-pmw \
 +
  libglew-dev freeglut3-dev libpng-dev libfreetype6-dev
  
To uninstall the PyMOL:
+
# Fedora
 +
yum install subversion python-devel freeglut-devel freetype-devel tkinter python-pmw
  
<source lang="bash">
+
# Gentoo
python setup2.py uninstall
+
emerge -av dev-vcs/subversion dev-lang/python dev-python/pmw media-libs/glew \
 +
  media-libs/freeglut media-libs/libpng media-libs/freetype
 
</source>
 
</source>
  
==== Installing without root Privileges ====
+
=== Get latest Source from SVN ===
  
Use the prefix command to specify where to install PyMOL:
+
This will download the latest source to '''/tmp/pymol''':
  
 
<source lang="bash">
 
<source lang="bash">
python setup.py install --prefix /dir_to/pymol/py_build
+
cd /tmp
</source>
+
svn co https://pymol.svn.sourceforge.net/svnroot/pymol/trunk/pymol pymol
 
+
cd pymol
Then, you'll need to modify your '''PYTHONPATH''' variable:
 
 
 
<source lang="bash">
 
export PYTHONPATH=$PYTHONPATH:/dir_to/pymol/py_build/lib/python{version}/site-packages
 
 
</source>
 
</source>
  
Install to prefix:
+
=== Compile and install ===
  
<source lang="bash">
+
This will install PyMOL as normal user into '''/opt/pymol-svn'''. If you don't have write permissions to '''/opt''', change the <code>prefix</code> variable to something like '''$HOME/pymol-svn'''.
python setup2.py install --prefix /dir_to/pymol/py_build
 
</source>
 
 
 
Now you can run PyMOL:
 
  
 
<source lang="bash">
 
<source lang="bash">
./pymol
+
#!/bin/bash -e
</source>
 
  
=== Compiling By Hand ===
+
prefix=/opt/pymol-svn
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
+
modules=$prefix/modules
* 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                 
 
--and--                                 
 
* (freeglut-2_4_0.tgz
 
--or--
 
* glut-3_7_6.tgz)
 
  
====Supported Packages====
+
python setup.py build install \
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'' '''.
+
    --home=$prefix \
 +
    --install-purelib=$modules \
 +
    --install-platlib=$modules
  
Once downloaded, see the file '''pymol/INSTALL''' and '''pymol/INSTALL.generic'''.
+
export PYTHONPATH=$modules:$PYTHONPATH
 
+
python setup2.py install
Here's the basic steps to install by source:
+
install pymol $prefix/
# get the source [http://delsci.com/rel/0_98/#OtherUnix PyMol Source]
 
# extract both packages, rename ext-VERSION.tgz to ext and move it into the pymol directory
 
# cd pymol
 
# cd ext
 
# vi build.com  # edit the build file
 
# cd ..
 
# cp setup/Rules.make . # or correct Rules.make file for your machine
 
# vi Rules.make        # make appropriate changes
 
# vi setup.py          # make appropriate changes
 
# make
 
 
 
Warnings:
 
* 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)/lib'''''64'''''/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'.
 
 
 
== External Links to Distribution-specific Packages ==
 
 
 
Some of the detailed information in the subsequent sections may be obsolete, so here are links to package information pages:
 
 
 
* Fedora: [https://admin.fedoraproject.org/pkgdb/packages/name/pymol]
 
 
 
* RHEL: [https://fedoraproject.org/wiki/SIGs/SciTech/PackageList]
 
 
 
* Ubuntu: [http://packages.ubuntu.com/jaunty/science/pymol]
 
 
 
* Debian: [http://packages.debian.org/lenny/pymol]
 
 
 
* OpenSUSE: [http://software.opensuse.org/search?p=1&q=pymol]
 
 
 
* Gentoo-portage: [http://gentoo-portage.com/sci-chemistry/pymol]
 
 
 
== Fedora ==
 
 
 
Starting from Fedora 9, you can install PyMOL from yum repositories.
 
 
 
As root:
 
 
 
<source lang="bash">
 
yum install pymol
 
</source>
 
 
 
This will install the latest precompiled version of PyMol. If you want the bleeding edge version or you have an older version of the operating system, follow the instructions for [http://pymolwiki.org/index.php/Linux_Install#Generic_Linux Generic Linux]. In order to satisfy all dependencies necessary for compiling from source issue as root (or superuser) the following command:
 
 
 
<source lang="bash">
 
yum install python-devel freeglut-devel freetype-devel tkinter python-pmw
 
 
</source>
 
</source>
  
== Gentoo Linux ==
+
Now launch PyMOL like this (you may copy this launcher into your '''$PATH''',
As root:
+
like to '''/usr/local/bin'''):
<source lang="bash">
 
emerge pymol
 
</source>
 
be sure to have the proper OpenGL configuration. For example:
 
<source lang="bash">
 
eselect opengl ati
 
eselect opengl nvidia
 
</source>
 
list of available versions in portage [http://www.gentoo-portage.com/sci-chemistry/pymol pymol for gentoo]
 
  
All beta releases are maintained in the science overlay, which can be used with
 
 
<source lang="bash">
 
<source lang="bash">
layman -a sci
+
/opt/pymol-svn/pymol
 
</source>
 
</source>
There is ongoing development in providing plugins via ebuilds with an thread in [http://bugs.gentoo.org/show_bug.cgi?id=209970 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.
+
== Problems ==
  
== SuSe ==
+
* gcc-4.5 is broken for pymol install, use gcc-4.4 (Mint11 Linux, PyMOL 1.4.1, reported by [[User:Tlinnet]])
=== 32-bit (x86) ===
+
* If you get an error message "ImportError: No module named Pmw" and lack half of the user interface, then run the additional command
See [[#Generic Linux]] above.
 
  
=== 64-bit (x86_64) ===
+
:<source lang="bash">
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).
+
python setup2.py install pmw
 
 
To install PyMol
 
*Ensure your system has it's distutils in place and ready to use.  Try the following check:
 
<source lang="python">
 
from distutils import *
 
</source>
 
*Download the [http://pymol.org/ source]
 
*Download [http://www.sf.net/projects/pmw Pmw] from [http://www.sf.net/ 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:
 
<source lang="python">
 
import * from Pmw
 
</source>
 
If errors erupt, investigate.
 
* decompress the source and cd into the PyMol directory that was just decompressed.
 
* If upgrading see [[:Category: Upgrading PyMol|below]].
 
* Now enter the following...
 
<code>
 
python setup.py build<br>
 
sudo python setup.py install<br>
 
sudo python setup2.py
 
</code>
 
* 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:
 
<source lang="python">
 
sudo cp ./pymol.com /usr/local/bin
 
</source>
 
Please note that newer versions of PyMol create the '''pymol''' executable, not '''pymol.com'''.  So, for later versions (~0.99+) use
 
<source lang="python">
 
sudo cp ./pymol /usr/local/bin
 
 
</source>
 
</source>
  
 
+
:to install a copy of the Python MegaWidgets.
You should now have a working PyMol install. 
 
 
 
'''pymol.com''' should now run your new PyMol install.
 
 
 
==Mint11 Linux (Ubuntu) - Tested for PyMOL 1.4.1 ==
 
 
 
From Source, one can build pymol
 
<source lang="bash">
 
## Tested on a fresh VirtualBox Linux Mint 11, 32bit
 
sudo apt-get install subversion
 
svn co https://pymol.svn.sourceforge.net/svnroot/pymol/trunk ~/
 
cd ~/pymol
 
## gcc-4.5 is broken for pymol install. So we use gcc-4.4
 
sudo apt-get install build-essential gcc-4.4 g++-4.4
 
export CC=/usr/bin/gcc-4.4
 
 
 
## From INSTALL we read we need, OpenGL, glut, libpng, tcl/tk, python,
 
## freetype2, and Pmw and some of their -devel packages
 
## I found these packages to be minimum
 
sudo apt-get install python-dev python-pmw libglew1.5-dev
 
sudo apt-get install freeglut3 freeglut3-dev
 
sudo apt-get install libpng12-dev
 
sudo apt-get install libfreetype6-dev
 
 
 
## Now we are ready to build
 
python setup.py build
 
sudo python setup.py install
 
sudo python setup2.py install
 
 
 
## Make a link, so we can call execute pymol
 
sudo ln -s ~/pymol/pymol /usr/bin/pymol
 
 
 
## To add a path/folder where you can put pymol scripts
 
echo 'import sys' >> ~/.pymolrc
 
echo 'sys.path.append("~/pymol/modules")' >> ~/.pymolrc
 
 
 
## Launch pymol
 
pymol
 
 
 
</source>
 
 
 
=Preparing your System=
 
See [[Linux_XFree86_Configuration]].
 
 
 
==Graphics==
 
===XFree86 Config===
 
Check out [[XFree86_Configuration|Configuring XFree86]] if you need information on editing the XFree86 configuration file.
 
  
 
[[Category:Installation|Linux Installation]]
 
[[Category:Installation|Linux Installation]]
 
===Xorg===
 
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
 
[http://www.nvnews.net/vbulletin/showthread.php?t=69136 NVNews]
 
 
===xorg.conf for stereo in Fedora Core 6===
 
It is assumed that you have installed the proprietary [http://www.nvidia.com/content/drivers/drivers.asp Nvidia graphics drivers], and that the "Device" section of xorg.conf has the following line in it:
 
 
<pre>
 
Driver "nvidia"
 
</pre>
 
 
Add the following section to the end of xorg.conf to disable "Composite", which is incompatible with stereographics.
 
 
<pre>
 
Section "Extensions"
 
    Option "Composite" "Disable"
 
EndSection
 
</pre>
 
 
In Section "Screen" add the following line to enable quad-buffered stereo:
 
 
<pre>Option "Stereo" "3"</pre>
 
 
=Problems=
 
 
==Input==
 
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
 
 
<pre>
 
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
 
</pre>
 
 
then try changing the permissons on  libnvidia-tls.so.1.  i.e,
 
 
<pre> sudo chmod 777 /usr/lib/libnvidia-tls.so.1  </pre>
 
 
==Super-Large Files==
 
For loading files that require the majority of your system's memory, try tweaking your system's [http://certcities.com/editorial/columns/story.asp?EditorialsID=214 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.'' '''
 
<source lang="bash">
 
# shows current setup
 
ulimit -a
 
 
# allows setting of a limit in current shell.
 
ulimit -v SizeInKB
 
</source>
 

Revision as of 11:45, 6 November 2011

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.