Linux Install: Difference between revisions

From PyMOLWiki
Jump to navigation Jump to search
(remove "sudo chmod 777")
(Adding Sabayon instructions and notes that these commands involving package managers should be run as root. Also yum->dnf for Fedora.)
Line 5: Line 5:
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.
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:
Command line install examples for some popular distributions (note that all of these commands must be run as root or superuser):


<source lang="bash">
<source lang="bash">
# Arch/Manjaro
pacman -S pymol
# CentOS with EPEL
rpm -i http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
yum --enablerepo=epel install pymol
# Debian/Ubuntu/Mint
# Debian/Ubuntu/Mint
sudo apt-get install pymol
apt-get install pymol


# Fedora
# Fedora
yum install pymol
dnf install pymol


# Gentoo
# Gentoo
Line 18: Line 25:


# openSUSE (12.1 and later)
# openSUSE (12.1 and later)
sudo zypper install pymol
zypper install pymol


# CentOS with EPEL
# Sabayon
rpm -i http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
equo i -av pymol
yum --enablerepo=epel install pymol
</source>
</source>


Line 42: Line 48:
* libxml2
* libxml2


On many Linux systems, one of the following commands installs all requirements:
On many Linux systems, one of the following commands installs all requirements (and must be run as root):


<source lang="bash">
<source lang="bash">
# Debian/Ubuntu/Mint
# Debian/Ubuntu/Mint
sudo apt-get install subversion build-essential python-dev python-pmw libglew-dev \
apt-get install subversion build-essential python-dev python-pmw libglew-dev \
   freeglut3-dev libpng-dev libfreetype6-dev libxml2-dev
   freeglut3-dev libpng-dev libfreetype6-dev libxml2-dev


# Fedora/CentOS
# CentOS
yum install subversion gcc gcc-c++ kernel-devel python-devel tkinter python-pmw glew-devel \
yum install subversion gcc gcc-c++ kernel-devel python-devel tkinter python-pmw glew-devel \
  freeglut-devel libpng-devel freetype-devel libxml2-devel
# Fedora
dnf install subversion gcc gcc-c++ kernel-devel python-devel tkinter python-pmw glew-devel \
   freeglut-devel libpng-devel freetype-devel libxml2-devel
   freeglut-devel libpng-devel freetype-devel libxml2-devel


Line 58: Line 68:


# openSUSE
# openSUSE
sudo zypper install python-devel freeglut-devel gcc-c++ glew-devel libpng-devel python-pmw subversion
zypper install python-devel freeglut-devel gcc-c++ glew-devel libpng-devel python-pmw subversion
 
# Sabayon
equo i -av dev-vcs/subversion dev-lang/python dev-python/pmw media-libs/glew \
  media-libs/freeglut media-libs/libpng media-libs/freetype
</source>
</source>



Revision as of 06:28, 14 January 2016

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 (note that all of these commands must be run as root or superuser):

# Arch/Manjaro
pacman -S pymol

# CentOS with EPEL
rpm -i http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
yum --enablerepo=epel install pymol

# Debian/Ubuntu/Mint
apt-get install pymol

# Fedora
dnf install pymol

# Gentoo
emerge -av pymol

# openSUSE (12.1 and later)
zypper install pymol

# Sabayon
equo i -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:

  • Subversion to download the source code
  • Python (with distutils)
  • Pmw (Python Megawidgets)
  • OpenGL driver (I use NVidia)
  • libpng
  • freetype
  • libxml2

On many Linux systems, one of the following commands installs all requirements (and must be run as root):

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

# CentOS
yum install subversion gcc gcc-c++ kernel-devel python-devel tkinter python-pmw glew-devel \
  freeglut-devel libpng-devel freetype-devel libxml2-devel

# Fedora
dnf install subversion gcc gcc-c++ kernel-devel python-devel tkinter python-pmw glew-devel \
  freeglut-devel libpng-devel freetype-devel libxml2-devel

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

# openSUSE
zypper install python-devel freeglut-devel gcc-c++ glew-devel libpng-devel python-pmw subversion

# Sabayon
equo i -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 svn://svn.code.sf.net/p/pymol/code/trunk/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

# enable c++11
export CPPFLAGS="-std=c++0x"

# If you want to install as root, then split this line up in "build"
# and "install" and run the "install" with "sudo"
python setup.py build install \
    --home=$prefix \
    --install-lib=$modules \
    --install-scripts=$prefix

Now launch PyMOL like this:

/opt/pymol-svn/pymol

Optionally, in order to allow running the command pymol from the terminal to launch the program do:

sudo ln -s /opt/pymol-svn/pymol /usr/bin/pymol

Updating

To update the installation merely run:

sudo rm -r /opt/pymol-svn/pymol
rm -r /tmp/pymol

and redo the installation from the beginning with the latest release.

Troubleshooting

  • On Linux Mint 11 there have been reports of gcc-4.5 breaking Pymol. You could use gcc-4.4 instead. (reported by User:Tlinnet)
sudo apt-get install build-essential gcc-4.4 g++-4.4
export CC=/usr/bin/gcc-4.4
  • If you get an error message "ImportError: No module named Pmw" and lack half of the user interface, then append --bundled-pmw to the install command line.
  • If you are using Ubuntu with a NVIDIA graphic card and generic drivers you may experience bad rendering, black pixelation and other graphical oddities. A guide to installing NVIDIA proprietary drivers can be found under Ubuntu community Nvidia Drivers How To

Customized Installations