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)
 
(84 intermediate revisions by 10 users not shown)
Line 1: Line 1:
This page describes how to install open-source PyMOL on Linux.
+
This page describes how to install PyMOL on Linux.
  
== Install distribution specific binary package ==
+
== Incentive PyMOL ==
 +
 
 +
[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.
 +
 
 +
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.
 
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">
# Debian/Ubuntu
+
# Arch/Manjaro
sudo apt-get install pymol
+
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
 
# Fedora
su -c 'yum install pymol'
+
dnf install pymol
  
 
# Gentoo
 
# Gentoo
su -c 'emerge -av pymol'
+
emerge -av pymol
  
 
# openSUSE (12.1 and later)
 
# openSUSE (12.1 and later)
sudo zypper install pymol
+
zypper install pymol
 +
 
 +
# Sabayon
 +
equo i -av pymol
 
</source>
 
</source>
  
Line 24: 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://github.com/schrodinger/pymol-open-source/blob/master/INSTALL INSTALL] file.
  
 
=== Requirements ===
 
=== Requirements ===
Line 30: Line 48:
 
required:
 
required:
  
* [http://subversion.apache.org/ Subversion] to download the source code
+
* C++11 compiler (e.g. GCC 4.7 or higher)
* [http://www.python.org/ Python] (with distutils)
+
* [http://www.python.org/ Python] 3.6+
* [http://pmw.sf.net Pmw] (Python Megawidgets)
 
 
* 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
 
* libpng
 
* libpng
 
* freetype
 
* 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>)
 +
 +
Optional/deprecated:
  
On many Linux systems, one of the following commands installs all requirements:
+
* [https://github.com/schrodinger/pmw-patched Pmw] (Python Megawidgets, for legacy GUI/plugins)
 +
* GLUT/freeglut (enable with <code>--glut</code>)
 +
 
 +
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/Mint11
+
# Debian/Ubuntu/Mint
sudo apt-get install subversion build-essential python-dev python-pmw \
+
apt-get install git build-essential python3-dev libglew-dev \
   libglew-dev freeglut3-dev libpng-dev libfreetype6-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
 
# Fedora
su -c 'yum install subversion python-devel freeglut-devel freetype-devel tkinter python-pmw'
+
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
 
# Gentoo
sudo -c 'emerge -av dev-vcs/subversion dev-lang/python dev-python/pmw media-libs/glew \
+
emerge -av dev-lang/python dev-python/pmw media-libs/glew \
   media-libs/freeglut media-libs/libpng media-libs/freetype'
+
   media-libs/freeglut media-libs/libpng media-libs/freetype media-libs/glm
  
 
# 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 glm
 +
 
 +
# Sabayon
 +
equo i -av dev-lang/python dev-python/pmw media-libs/glew \
 +
  media-libs/freeglut media-libs/libpng media-libs/freetype
 
</source>
 
</source>
  
=== Get latest source from SVN ===
+
=== Get latest source from Git ===
 
 
This will download the latest source to '''/tmp/pymol''':
 
  
 
<source lang="bash">
 
<source lang="bash">
cd /tmp
+
git clone https://github.com/schrodinger/pymol-open-source.git
svn co https://pymol.svn.sourceforge.net/svnroot/pymol/trunk/pymol pymol
+
git clone https://github.com/rcsb/mmtf-cpp.git
cd pymol
+
mv mmtf-cpp/include/mmtf* pymol-open-source/include/
 +
cd pymol-open-source
 
</source>
 
</source>
  
=== Compile and 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.''
 
 
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'''.
 
  
<source lang="bash">
+
=== Libraries in non-standard places ===
#!/bin/bash -e
 
  
prefix=/opt/pymol-svn
+
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).
modules=$prefix/modules
 
  
python setup.py build install \
+
=== Compile and install ===
    --home=$prefix \
 
    --install-purelib=$modules \
 
    --install-platlib=$modules
 
 
 
export PYTHONPATH=$modules:$PYTHONPATH
 
python setup2.py install
 
install pymol $prefix/
 
</source>
 
  
Now launch PyMOL like this (you may copy this launcher into your '''$PATH''',
+
This will install PyMOL as normal user into <code>$HOME/pymol-open-source-build</code>.
like to '''/usr/local/bin'''):
 
  
 
<source lang="bash">
 
<source lang="bash">
/opt/pymol-svn/pymol
+
#!/bin/bash -e
</source>
 
  
=== Problems ===
+
prefix=$HOME/pymol-open-source-build
  
* gcc-4.5 is broken for pymol install, use gcc-4.4 (Mint11 Linux, PyMOL 1.4.1, reported by [[User:Tlinnet]])
+
# Example for dependencies in non-standard places
<source lang="bash">
+
# export PREFIX_PATH="$HOME/extra/glew-2.0.0:$HOME/extra/libpng-1.6.5:/opt/local"
sudo apt-get install build-essential gcc-4.4 g++-4.4
 
export CC=/usr/bin/gcc-4.4
 
</source>
 
  
* If you get an error message "ImportError: No module named Pmw" and lack half of the user interface, then run the additional command
+
python3 setup.py build install \
<source lang="bash">
+
    --home=$prefix
python setup2.py install pmw
 
 
</source>
 
</source>
to install a copy of the Python MegaWidgets.
 
  
== Ubuntu/Mint compile and install with MPEG support ==
+
Now launch PyMOL like this:
Make a text file "installpymol.sh" and make it executable
 
<source lang="bash">
 
chmod u+x installpymol.sh
 
</source>
 
  
Put this in the file, modify the first 3 lines
 
 
<source lang="bash">
 
<source lang="bash">
#!/bin/bash -e
+
$HOME/pymol-open-source-build/bin/pymol
pymolsvn=/home/tlinnet/Software/pymol/svnpymol
 
pymoldir=/home/tlinnet/Software/pymol
 
freemolsvn=/home/tlinnet/Software/pymol/svnfreemol
 
 
###################################################
 
[ -d $pymoldir ] || mkdir $pymoldir
 
[ -d $pymolsvn ] || mkdir $pymolsvn
 
[ -d $pymoldir/wikiscripts ] || mkdir $pymoldir/wikiscripts
 
 
sudo apt-get install subversion build-essential python-dev python-pmw \
 
libglew-dev freeglut3-dev libpng-dev libfreetype6-dev
 
 
# gcc 4.5 broken for install in ubuntu
 
sudo apt-get install gcc-4.4 g++-4.4
 
export CC=/usr/bin/gcc-4.4
 
 
svn co https://pymol.svn.sourceforge.net/svnroot/pymol/trunk/pymol $pymolsvn
 
 
modules=$pymoldir/modules
 
cd $pymolsvn
 
python setup.py build
 
sudo python setup.py install
 
sudo python setup.py install --home=$pymoldir --install-purelib=$modules --install-platlib=$modules
 
export PYTHONPATH=$modules:$PYTHONPATH
 
sudo python setup2.py install
 
install $pymolsvn/pymol $pymoldir/
 
 
## To add a path/folder where you can put pymol wikiscripts
 
t="'"
 
echo "import sys" >> ~/.pymolrc
 
echo "sys.path.append($t$pymoldir/wikiscripts$t)" >> ~/.pymolrc
 
 
########## Setup freemol - for MPEG support ############
 
[ -d $pymolsvn ] || mkdir $freemolsvn
 
svn co svn://bioinformatics.org/svnroot/freemol/trunk $freemolsvn
 
 
cd $freemolsvn/src/mpeg_encode
 
export FREEMOL=$freemolsvn/freemol
 
./configure
 
make
 
make install
 
 
## Make a shortcut to export freemol and then execute pymol
 
echo '#!/bin/bash' >> $pymoldir/pymolMPEG.sh
 
echo "export FREEMOL=$freemolsvn/freemol" >> $pymoldir/pymolMPEG.sh
 
echo "#$pymoldir/pymol" >> $pymoldir/pymolMPEG.sh
 
tail -n +2 $pymoldir/pymol >> $pymoldir/pymolMPEG.sh
 
chmod u+x $pymoldir/pymolMPEG.sh
 
 
## Make a link, so we can call execute pymol
 
sudo ln -s $pymoldir/pymolMPEG.sh /usr/bin/pymol
 
 
</source>
 
</source>
  
=== Update script ===
+
=== Troubleshooting ===
To pull and update PyMOL, one can make this script
 
  
Make a text file "updatepymol.sh" and make it executable
+
* Do do a "clean" build, remove the "build" directory (sometimes necessary if "git pull" changed header files)
<source lang="bash">
 
chmod u+x updatepymol.sh
 
</source>
 
  
Put this in the file, modify the first 3 lines
+
* 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">
 
#!/bin/bash -e
 
pymolsvn=/home/tlinnet/Software/pymol/svnpymol
 
pymoldir=/home/tlinnet/Software/pymol
 
freemolsvn=/home/tlinnet/Software/pymol/svnfreemol
 
 
# gcc 4.5 broken for install in ubuntu
 
export CC=/usr/bin/gcc-4.4
 
 
svn up $pymolsvn
 
svn up $freemolsvn
 
 
modules=$pymoldir/modules
 
cd $pymolsvn
 
python setup.py build
 
sudo python setup.py install
 
sudo python setup.py install --home=$pymoldir --install-purelib=$modules --install-platlib=$modules
 
export PYTHONPATH=$modules:$PYTHONPATH
 
sudo python setup2.py install
 
install $pymolsvn/pymol $pymoldir/
 
 
########## Setup freemol - for MPEG support ############
 
cd $freemolsvn/src/mpeg_encode
 
export FREEMOL=$freemolsvn/freemol
 
./configure
 
make
 
make install
 
</source>
 
  
=== Change MPEG settings ===
+
== Customized Installations ==
Change settings in
 
<source lang="bash">
 
/home/tlinnet/Software/pymol/svnfreemol/freemol/libpy/freemol/mpeg_encode.py
 
</source>
 
For example, change in line 205:<br>
 
FRAME_RATE 24<br>
 
(Not, only legal values is allowed: 23.976, 24, 25, 29.97, 30, 50 ,59.94, 60)
 
  
Then restart PyMOL.
+
* [[User:Tlinnet/Linux_Install|Troels Linnet's installations scripts]]: Detailed installation scripts for Ubuntu, Mint 12 and RHEL 6, including MPEG support from FREEMOL
  
 
[[Category:Installation|Linux Installation]]
 
[[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