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)
 
(106 intermediate revisions by 12 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])
 
* libpng
 
  
== Generic Linux ==
+
Download: https://pymol.org/
  
=== From Source ===
+
== Open-Source PyMOL in Linux Distros ==
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.  
+
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.
  
To obtain a copy of the current revision version issue the command:
+
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">
svn co https://pymol.svn.sourceforge.net/svnroot/pymol/trunk/pymol pymol
+
# Arch/Manjaro
</source>
+
pacman -S pymol
  
Then go into the source directory:
+
# CentOS with EPEL
 +
rpm -i http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
 +
yum --enablerepo=epel install pymol
  
<source lang="bash">
+
# Debian/Ubuntu/Mint
cd pymol
+
apt-get install pymol
</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]
+
# Fedora
 +
dnf install pymol
  
Run the first stage of the installation:
+
# Gentoo
 +
emerge -av pymol
  
<source lang="bash">
+
# openSUSE (12.1 and later)
python setup.py install
+
zypper install pymol
</source>
 
  
Run the second stage of the installation:
+
# Sabayon
<source lang="bash">
+
equo i -av pymol
python setup2.py install
 
 
</source>
 
</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:
+
== Install from source ==
  
<source lang="bash">
+
Installation from source gives you the latest version and is the generic way to install PyMOL.
cp ./pymol /usr/local/bin
 
</source>
 
  
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:
+
Please also consult the [https://github.com/schrodinger/pymol-open-source/blob/master/INSTALL INSTALL] file.
  
<source lang="bash">
+
=== Requirements ===
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:
+
Libraries as well as development files (headers) of the following software is
 +
required:
  
<source lang="bash">
+
* C++11 compiler (e.g. GCC 4.7 or higher)
svn up
+
* [http://www.python.org/ Python] 3.6+
</source>
+
* 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>)
  
To uninstall the PyMOL:
+
Optional/deprecated:
  
<source lang="bash">
+
* [https://github.com/schrodinger/pmw-patched Pmw] (Python Megawidgets, for legacy GUI/plugins)
python setup2.py uninstall
+
* GLUT/freeglut (enable with <code>--glut</code>)
</source>
 
  
==== Installing without root Privileges ====
+
On many Linux systems, one of the following commands installs all requirements (and must be run as root):
  
Use the prefix command to specify where to 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
  
<source lang="bash">
+
# CentOS
python setup.py install --prefix /dir_to/pymol/py_build
+
yum install gcc gcc-c++ kernel-devel python-devel tkinter python-pmw glew-devel \
</source>
+
  freeglut-devel libpng-devel freetype-devel libxml2-devel glm-devel \
 +
  msgpack-devel netcdf-devel
  
Then, you'll need to modify your '''PYTHONPATH''' variable:
+
# 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
  
<source lang="bash">
+
# Gentoo
export PYTHONPATH=$PYTHONPATH:/dir_to/pymol/py_build/lib/python{version}/site-packages
+
emerge -av dev-lang/python dev-python/pmw media-libs/glew \
</source>
+
  media-libs/freeglut media-libs/libpng media-libs/freetype media-libs/glm
  
Install to prefix:
+
# openSUSE
 +
zypper install python-devel freeglut-devel gcc-c++ glew-devel libpng-devel python-pmw glm
  
<source lang="bash">
+
# Sabayon
python setup2.py install --prefix /dir_to/pymol/py_build
+
equo i -av dev-lang/python dev-python/pmw media-libs/glew \
 +
  media-libs/freeglut media-libs/libpng media-libs/freetype
 
</source>
 
</source>
  
Now you can run PyMOL:
+
=== Get latest source from Git ===
  
 
<source lang="bash">
 
<source lang="bash">
./pymol
+
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>
 
</source>
  
=== Compiling By Hand ===
+
''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.''
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                 
 
--and--                                 
 
* (freeglut-2_4_0.tgz
 
--or--
 
* glut-3_7_6.tgz)
 
  
====Supported Packages====
+
=== Libraries in non-standard places ===
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'''.
+
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).
  
Here's the basic steps to install by source:
+
=== Compile and install ===
# 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:
+
This will install PyMOL as normal user into <code>$HOME/pymol-open-source-build</code>.
* 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'.
+
<source lang="bash">
 
+
#!/bin/bash -e
== 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]
+
prefix=$HOME/pymol-open-source-build
  
* Gentoo-portage: [http://gentoo-portage.com/sci-chemistry/pymol]
+
# Example for dependencies in non-standard places
 +
# export PREFIX_PATH="$HOME/extra/glew-2.0.0:$HOME/extra/libpng-1.6.5:/opt/local"
  
== Fedora ==
+
python3 setup.py build install \
 
+
    --home=$prefix
Starting from Fedora 9, you can install PyMOL from yum repositories.
 
 
 
As root:
 
 
 
<source lang="bash">
 
yum install pymol
 
 
</source>
 
</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:
+
Now launch PyMOL like this:
  
 
<source lang="bash">
 
<source lang="bash">
yum install python-devel freeglut-devel freetype-devel tkinter python-pmw
+
$HOME/pymol-open-source-build/bin/pymol
 
</source>
 
</source>
  
== Gentoo Linux (x86) ==
+
=== Troubleshooting ===
as root:
 
<source lang="bash">
 
emerge pymol
 
</source>
 
be sure to have the proper OpenGL configuration. For example:
 
<source lang="bash">
 
opengl-update ati
 
opengl-update nvidia
 
</source>
 
list of available versions in portage [http://www.gentoo-portage.com/sci-chemistry/pymol pymol for gentoo]
 
  
A version of the latest svn build is avaible via the dberkholz overlay, which can be used with
+
* Do do a "clean" build, remove the "build" directory (sometimes necessary if "git pull" changed header files)
<source lang="bash">
 
layman -a dberkholz && emerge =sci-chemistry/pymol-9999
 
</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.
 
 
 
== SuSe ==
 
=== 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:
 
<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>
 
 
 
 
 
You should now have a working PyMol install. 
 
 
 
'''pymol.com''' should now run your new PyMol install.
 
 
 
==Ubuntu Linux (x86 32,64; mac ppc)==
 
 
 
http://xanana.ucsc.edu/~wgscott/xtal/ubuntu-small.png
 
  
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
+
* 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]
<source lang="bash">
 
sudo apt-get install pymol
 
</source>
 
once the [http://ubuntuguide.org/#extrarepositories universe repository] has been activated. 
 
  
[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.
+
== Customized Installations ==
  
'''NOTE : '''If you experience problems with PyMOL OpenGL window (i.e. flickering) try disabling compiz.
+
* [[User:Tlinnet/Linux_Install|Troels Linnet's installations scripts]]: Detailed installation scripts for Ubuntu, Mint 12 and RHEL 6, including MPEG support from FREEMOL
 
 
=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>
 

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