This is a read-only mirror of pymolwiki.org

Difference between revisions of "Linux Install"

From PyMOL Wiki
Jump to navigation Jump to search
m (1 revision)
 
(143 intermediate revisions by 19 users not shown)
Line 1: Line 1:
Installing PyMol is quite straightforward.
+
This page describes how to install PyMOL on Linux.
  
=PyMol=
+
== Incentive PyMOL ==
Installing PyMol is very simple, even from source.  On Linux, you need the following requirements:
+
 
* [http://www.python.org/ Python] (with distutils)
+
[http://www.schrodinger.com Schrödinger] provides pre-compiled (64 bit) PyMOL to paying sponsors. The bundle also includes ready-to-use [[APBS]], [[morph|RigiMOL]], an MPEG encoder for movie export, and a small molecule energy minimization engine.
* [http://pmw.sf.net Pmw] (Python Megawidgets)
 
* OpenGL driver (I use [http://www.nvidia.com/object/unix.html NVidia])
 
  
== Generic Linux ==
+
Download: https://pymol.org/
  
=== 0.99rc1 note! ===
+
== Open-Source PyMOL in Linux Distros ==
For those keeping current via CVS, building from source, or installing precompiled unix binaries, here is a quick "heads up!" intended to save you some minor grief: For the last six years, the PyMOL launch script has been called '''pymol.com''' instead of simply "pymol".  I can't remember why I did things that way, but PyMOL's ".com" convention is different from the most everything else and for no good reason.  The launch script should just be the name of the program.
 
  
Therefore, as of 0.99rc1, the launch script will simply be "pymol".  No big deal right?  Well, not so fast:  symbolic links, shell aliases, external scripts, package builders, and end-user habits may all need to be adjusted after installing this next version.  That is why I haven't changed this before now -- but we should clean this up before 1.0. So, remember: if you update to PyMOL 0.99rc1 (when it's released) and suddenly can't launch PyMOL, that is likely what is going on.  Either reset your pointers to '''./pymol''', or symlink '''./pymol''' to '''./pymol.com''' to preserve the status quo.
+
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 (note that all of these commands must be run as root or superuser):
* untar the compressed package;
 
* 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 setup2.py install          # you may need to be root</source>
 
* execute <source lang="python">cp ./pymol.com SOME_PATH          # where SOME_PATH is some directory in your $PATH</source>
 
or for the latest version,
 
* execute <source lang="python">cp ./pymol SOME_PATH          # where SOME_PATH is some directory in your $PATH</source>
 
The executable name is "pymol.com".
 
  
=== From Package ===
+
<source lang="bash">
Download the appropriate RPM and use 'rpm' to install it.  Typically,
+
# Arch/Manjaro
rpm -Uvh rpmFileName.rpm
+
pacman -S pymol
  
===Compiling By Hand===
+
# CentOS with EPEL
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. 
+
rpm -i http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
 +
yum --enablerepo=epel install pymol
  
Once downloaded, see the file '''pymol/INSTALL''' and '''pymol/INSTALL.generic'''.
+
# Debian/Ubuntu/Mint
 +
apt-get install pymol
  
Here's the basic steps to install by source:
+
# Fedora
# get the source [http://delsci.com/rel/0_98/#OtherUnix PyMol Source]
+
dnf install pymol
# 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:
+
# Gentoo
* if you're using a 64-bit machine, lib becomes lib64 for almost everything
+
emerge -av pymol
* 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.
 
  
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'.
+
# openSUSE (12.1 and later)
 +
zypper install pymol
  
== Fedora Core Linux (x86) ==
+
# Sabayon
PyMOL RPMs are available for Fedora Core 1 & 2, provided by Morten Kjeldgaard. These can be manually downloaded by browsing from: [http://apt.bioxray.dk/]
+
equo i -av pymol
 +
</source>
  
Alternatively, PyMOL can be installed using [http://linux.duke.edu/projects/yum/ 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:
+
== Install from source ==
  
[xray]
+
Installation from source gives you the latest version and is the generic way to install PyMOL.
name=MOKs RPM Repository fedora $releasever - $basearch - xray
 
baseurl=http://apt.bioxray.dk/fedora/fc$releasever/$basearch/xray
 
  
 +
Please also consult the [https://github.com/schrodinger/pymol-open-source/blob/master/INSTALL INSTALL] file.
  
you may also need to add the pgp key for the repository before yum will get packages from it by either saying:
+
=== Requirements ===
  
rpm --import http://www.bioxray.dk/~mok/404825e7.asc
+
Libraries as well as development files (headers) of the following software is
 +
required:
  
or with older versions of rpm:
+
* C++11 compiler (e.g. GCC 4.7 or higher)
 +
* [http://www.python.org/ Python] 3.6+
 +
* OpenGL driver (I use [http://www.nvidia.com/object/unix.html NVidia])
 +
* GLEW
 +
* libpng
 +
* freetype
 +
* libxml2 (optional, for COLLADA export, disable with <code>--no-libxml</code>)
 +
* [https://github.com/msgpack/msgpack-c msgpack-c] 2.1.5+ (optional, for fast [http://mmtf.rcsb.org/ MMTF] loading, new in SVN r4167, disable with <code>--use-msgpackc=no</code>)
 +
* PyQt5, PyQt4, or PySide (optional, will fall back to Tk interface if compiled with <code>--glut</code>)
 +
* [https://glm.g-truc.net/ glm]
 +
* [https://github.com/rcsb/mmtf-cpp mmtf-cpp] (optional, for [http://mmtf.rcsb.org/ MMTF] export, disable with <code>--use-msgpackc=no</code>)
 +
* libnetcdf (optional, disable with <code>--no-vmd-plugins</code>)
  
wget http://www.bioxray.dk/~mok/404825e7.asc
+
Optional/deprecated:
rpm --import 404825e7.asc
 
  
 +
* [https://github.com/schrodinger/pmw-patched Pmw] (Python Megawidgets, for legacy GUI/plugins)
 +
* GLUT/freeglut (enable with <code>--glut</code>)
  
And then issuing the following command as root:
+
On many Linux systems, one of the following commands installs all requirements (and must be run as root):
  
yum install pymol
+
<source lang="bash">
 +
# Debian/Ubuntu/Mint
 +
apt-get install git build-essential python3-dev libglew-dev \
 +
  libpng-dev libfreetype6-dev libxml2-dev \
 +
  libmsgpack-dev python3-pyqt5.qtopengl libglm-dev libnetcdf-dev
  
== Gentoo Linux (x86) ==
+
# CentOS
as root:
+
yum install gcc gcc-c++ kernel-devel python-devel tkinter python-pmw glew-devel \
emerge pymol
+
  freeglut-devel libpng-devel freetype-devel libxml2-devel glm-devel \
be sure to have the proper OpenGL configuration. For example:
+
  msgpack-devel netcdf-devel
opengl-update ati
 
opengl-update nvidia
 
list of available versions of [http://packages.gentoo.org/packages/?category=sci-chemistry;name=pymol pymol for gentoo]
 
  
== SuSe ==
+
# Fedora
=== 32-bit (x86) ===
+
dnf install gcc gcc-c++ kernel-devel python3-devel glew-devel PyQt5 msgpack-devel \
See [[#Generic Linux]] above.
+
  freeglut-devel libpng-devel freetype-devel libxml2-devel glm-devel
  
=== 64-bit (x86_64) ===
+
# Gentoo
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).
+
emerge -av dev-lang/python dev-python/pmw media-libs/glew \
 +
  media-libs/freeglut media-libs/libpng media-libs/freetype media-libs/glm
  
To install PyMol
+
# openSUSE
*Ensure your system has it's distutils in place and ready to use.  Try the following check:
+
zypper install python-devel freeglut-devel gcc-c++ glew-devel libpng-devel python-pmw glm
<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:
+
# Sabayon
<source lang="python">
+
equo i -av dev-lang/python dev-python/pmw media-libs/glew \
sudo cp ./pymol.com /usr/local/bin
+
  media-libs/freeglut media-libs/libpng media-libs/freetype
</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>
  
 +
=== Get latest source from Git ===
  
You should now have a working PyMol install.
+
<source lang="bash">
 +
git clone https://github.com/schrodinger/pymol-open-source.git
 +
git clone https://github.com/rcsb/mmtf-cpp.git
 +
mv mmtf-cpp/include/mmtf* pymol-open-source/include/
 +
cd pymol-open-source
 +
</source>
  
'''pymol.com''' should now run your new PyMol install.
+
''The master branch requires Python 3.6+. Use the legacy [https://github.com/schrodinger/pymol-open-source/tree/py2 py2] branch for Python 2.7 compatibility.''
  
==Ubuntu Linux (x86 32,64; mac ppc)==
+
=== Libraries in non-standard places ===
http://ubuntuforum  s.org/images/ubuntu-small.gif
 
  
The [http://www.ubuntu.com/ Ubuntu] [http://packages.ubuntu.com/breezy/science/pymol pymol package] can be installed with minimal effort using the GUI package manager [http://en.wikipedia.org/wiki/Synaptic_Package_Manager synaptic], or on the command line, using the command
+
Optional: You may use the colon-delimited <code>$PREFIX_PATH</code> variable to point <code>setup.py</code> to non-standard locations of libraries and headers (those locations should have <code>include</code> and <code>lib</code> directories).
  
sudo apt-get install pymol
+
=== Compile and install ===
  
once the [http://ubuntuguide.org/#extrarepositories universe repository] has been activated. 
+
This will install PyMOL as normal user into <code>$HOME/pymol-open-source-build</code>.
  
[http://en.wikipedia.org/wiki/Ubuntu_Linux Ubuntu] is a completely free and well-maintained Debian GNU/Linux distribution. Further details on using [http://xanana.ucsc.edu/linux/debian_linux.html Ubuntu for crystallography] and related applications are available are linked. PyMol also compiles from source on Ubuntu following the [[#Generic Linux]] instructions given above.
+
<source lang="bash">
 +
#!/bin/bash -e
  
=Preparing your System=
+
prefix=$HOME/pymol-open-source-build
See [[Linux_XFree86_Configuration]].
 
  
==Graphics==
+
# Example for dependencies in non-standard places
===XFree86 Config===
+
# export PREFIX_PATH="$HOME/extra/glew-2.0.0:$HOME/extra/libpng-1.6.5:/opt/local"
Check out [[XFree86_Configuration|Configuring XFree86]] if you need information on editing the XFree86 configuration file.
 
  
[[Category:Installation|Linux Installation]]
+
python3 setup.py build install \
 +
    --home=$prefix
 +
</source>
  
=Problems=
+
Now launch PyMOL like this:
  
==Input==
+
<source lang="bash">
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.
+
$HOME/pymol-open-source-build/bin/pymol
 +
</source>
  
==libnvidia-tls.so.1: cannot handle TLS data==
+
=== Troubleshooting ===
  
If you get an error, upon invoking pymol, of the form
+
* Do do a "clean" build, remove the "build" directory (sometimes necessary if "git pull" changed header files)
  
<pre>
+
* 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 [https://help.ubuntu.com/community/BinaryDriverHowto/Nvidia Ubuntu community Nvidia Drivers How To]
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 [http://imgseek.sourceforge.net/faq.html#faq3 move the file] <tt> mv /usr/lib/tls/ibnvidia-tls.so.1</tt>, e.g:
+
== Customized Installations ==
  
sudo mv /usr/lib/tls /usr/lib/ibnvidia-tls.so.1  /usr/lib/tls /usr/lib/ibnvidia-tls.so.1.bak
+
* [[User:Tlinnet/Linux_Install|Troels Linnet's installations scripts]]: Detailed installation scripts for Ubuntu, Mint 12 and RHEL 6, including MPEG support from FREEMOL
  
This temporarily cures the problem for me (Ubuntu 5.10; nvidia driver), but creates display problems upon rebooting.
+
[[Category:Installation|Linux Installation]]

Latest revision as of 05:01, 22 June 2020

This page describes how to install PyMOL on Linux.

Incentive PyMOL

Schrödinger provides pre-compiled (64 bit) PyMOL to paying sponsors. The bundle also includes ready-to-use APBS, RigiMOL, an MPEG encoder for movie export, and a small molecule energy minimization engine.

Download: https://pymol.org/

Open-Source PyMOL in Linux Distros

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.

Please also consult the INSTALL file.

Requirements

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

  • C++11 compiler (e.g. GCC 4.7 or higher)
  • Python 3.6+
  • OpenGL driver (I use NVidia)
  • GLEW
  • libpng
  • freetype
  • libxml2 (optional, for COLLADA export, disable with --no-libxml)
  • msgpack-c 2.1.5+ (optional, for fast MMTF loading, new in SVN r4167, disable with --use-msgpackc=no)
  • PyQt5, PyQt4, or PySide (optional, will fall back to Tk interface if compiled with --glut)
  • glm
  • mmtf-cpp (optional, for MMTF export, disable with --use-msgpackc=no)
  • libnetcdf (optional, disable with --no-vmd-plugins)

Optional/deprecated:

  • Pmw (Python Megawidgets, for legacy GUI/plugins)
  • GLUT/freeglut (enable with --glut)

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

# Debian/Ubuntu/Mint
apt-get install git build-essential python3-dev libglew-dev \
  libpng-dev libfreetype6-dev libxml2-dev \
  libmsgpack-dev python3-pyqt5.qtopengl libglm-dev libnetcdf-dev

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

# Fedora
dnf install gcc gcc-c++ kernel-devel python3-devel glew-devel PyQt5 msgpack-devel \
  freeglut-devel libpng-devel freetype-devel libxml2-devel glm-devel

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

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

# Sabayon
equo i -av dev-lang/python dev-python/pmw media-libs/glew \
  media-libs/freeglut media-libs/libpng media-libs/freetype

Get latest source from Git

git clone https://github.com/schrodinger/pymol-open-source.git
git clone https://github.com/rcsb/mmtf-cpp.git
mv mmtf-cpp/include/mmtf* pymol-open-source/include/
cd pymol-open-source

The master branch requires Python 3.6+. Use the legacy py2 branch for Python 2.7 compatibility.

Libraries in non-standard places

Optional: You may use the colon-delimited $PREFIX_PATH variable to point setup.py to non-standard locations of libraries and headers (those locations should have include and lib directories).

Compile and install

This will install PyMOL as normal user into $HOME/pymol-open-source-build.

#!/bin/bash -e

prefix=$HOME/pymol-open-source-build

# Example for dependencies in non-standard places
# export PREFIX_PATH="$HOME/extra/glew-2.0.0:$HOME/extra/libpng-1.6.5:/opt/local"

python3 setup.py build install \
    --home=$prefix

Now launch PyMOL like this:

$HOME/pymol-open-source-build/bin/pymol

Troubleshooting

  • Do do a "clean" build, remove the "build" directory (sometimes necessary if "git pull" changed header files)
  • 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