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)
(PREFIX_PATH, clean up out-dated info)
Line 40: Line 40:
  
 
Installation from source gives you the latest version and is the generic way to install PyMOL.
 
Installation from source gives you the latest version and is the generic way to install PyMOL.
 +
 +
Please also consult the [https://sourceforge.net/p/pymol/code/HEAD/tree/trunk/pymol/INSTALL INSTALL] file.
  
 
=== Requirements ===
 
=== Requirements ===
Line 51: Line 53:
 
* OpenGL driver (I use [http://www.nvidia.com/object/unix.html NVidia])
 
* OpenGL driver (I use [http://www.nvidia.com/object/unix.html NVidia])
 
* GLEW
 
* GLEW
* GLUT (freeglut)
+
* GLUT/freeglut (optional, disable with <code>--no-glut</code>)
 
* libpng
 
* libpng
 
* freetype
 
* freetype
Line 89: Line 91:
 
=== Get latest source from SVN ===
 
=== Get latest source from SVN ===
  
This will download the latest source to '''/tmp/pymol''':
+
This will download the latest source to <code>/tmp/pymol</code>:
  
 
<source lang="bash">
 
<source lang="bash">
 
cd /tmp
 
cd /tmp
svn co svn://svn.code.sf.net/p/pymol/code/trunk/pymol
+
svn co https://svn.code.sf.net/p/pymol/code/trunk/pymol
 
cd pymol
 
cd pymol
 
</source>
 
</source>
  
<div class="mw-collapsible mw-collapsed" style="width: 600px; padding: 0px 8px; background-color: #fc9;">
+
=== Libraries in non-standard places ===
'''Troubleshooting:''' Connection refused...
 
<div class="mw-collapsible-content" style="padding: 2px;">
 
If the above address is not available, giving an error such as
 
  
Connection refused: Unable to connect to a repository at URL <nowiki>'svn://svn.code.sf.net/p/pymol/code/trunk/pymol'</nowiki>: Can't connect to host 'svn.code.sf.net': Connection refused...
+
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).
 
 
you can try using <code>http://</code> instead of <code>svn://</code> in the URL.
 
</div>
 
</div>
 
  
 
=== Compile and install ===
 
=== 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 <code>prefix</code> variable to something like '''$HOME/pymol-svn'''.
+
This will install PyMOL as normal user into <code>$HOME/opt/pymol-svn</code>.
  
 
<source lang="bash">
 
<source lang="bash">
 
#!/bin/bash -e
 
#!/bin/bash -e
  
prefix=/opt/pymol-svn
+
prefix=$HOME/opt/pymol-svn
 
modules=$prefix/modules
 
modules=$prefix/modules
 +
 +
# Example for dependencies in non-standard places
 +
# export PREFIX_PATH="$HOME/extra/glew-2.0.0:$HOME/extra/libpng-1.6.5:/opt/local"
  
 
# If you want to install as root, then split this line up in "build"
 
# If you want to install as root, then split this line up in "build"
Line 129: Line 127:
  
 
<source lang="bash">
 
<source lang="bash">
/opt/pymol-svn/pymol
+
$HOME/opt/pymol-svn/pymol
 
</source>
 
</source>
  
 
Optionally, in order to allow running the command <code>pymol</code> from the terminal to launch the program do:
 
Optionally, in order to allow running the command <code>pymol</code> from the terminal to launch the program do:
 
<source lang = "bash">
 
<source lang = "bash">
sudo ln -s /opt/pymol-svn/pymol /usr/bin/pymol
+
sudo ln -s $HOME/opt/pymol-svn/pymol /usr/bin/pymol
 
</source>
 
</source>
 
====Updating====
 
To update the installation merely run:
 
<source lang = "bash">
 
sudo rm -r /opt/pymol-svn/pymol
 
rm -r /tmp/pymol
 
</source>
 
and redo the installation from the beginning with the latest release.
 
  
 
=== Troubleshooting ===
 
=== 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]])
 
<div style="margin-left: 2em;">
 
<source lang="bash">
 
sudo apt-get install build-essential gcc-4.4 g++-4.4
 
export CC=/usr/bin/gcc-4.4
 
</source>
 
</div>
 
  
 
* If you get an error message "ImportError: No module named Pmw" and lack half of the user interface, then append <code>--bundled-pmw</code> to the install command line.
 
* If you get an error message "ImportError: No module named Pmw" and lack half of the user interface, then append <code>--bundled-pmw</code> to the install command line.
 
* If you're using Ubuntu 11.10 with an Intel Sandy Bridge video card and get graphics oddities. Please see [https://launchpad.net/~glasen/+archive/intel-driver Intel Driver Post for Ubuntu].
 
  
 
* 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]
 
* 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]

Revision as of 11:47, 11 June 2018

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:

  • Subversion to download the source code
  • Python (with distutils)
  • Pmw (Python Megawidgets)
  • OpenGL driver (I use NVidia)
  • GLEW
  • GLUT/freeglut (optional, disable with --no-glut)
  • libpng
  • freetype
  • libxml2 (optional, for COLLADA export, disable with --no-libxml)
  • msgpack-c 1.0+ (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)
  • simplemmtf (optional, for MMTF export)

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 \
  libmsgpack-dev python-pyqt5.qtopengl

# 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 https://svn.code.sf.net/p/pymol/code/trunk/pymol
cd pymol

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/opt/pymol-svn.

#!/bin/bash -e

prefix=$HOME/opt/pymol-svn
modules=$prefix/modules

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

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

Now launch PyMOL like this:

$HOME/opt/pymol-svn/pymol

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

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

Troubleshooting

  • 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