Linux Install: Difference between revisions

From PyMOLWiki
Jump to navigation Jump to search
Line 113: Line 113:
pymoldir=/home/tlinnet/Software/pymol
pymoldir=/home/tlinnet/Software/pymol
freemolsvn=/home/tlinnet/Software/pymol/svnfreemol
freemolsvn=/home/tlinnet/Software/pymol/svnfreemol
 
###################################################
###################################################
[ -d $pymoldir ] || mkdir $pymoldir
[ -d $pymoldir ] || mkdir $pymoldir
[ -d $pymolsvn ] || mkdir $pymolsvn
[ -d $pymolsvn ] || mkdir $pymolsvn
[ -d $pymoldir/wikiscripts ] || mkdir $pymoldir/wikiscripts
[ -d $pymoldir/wikiscripts ] || mkdir $pymoldir/wikiscripts
 
sudo apt-get install subversion build-essential python-dev python-pmw \
sudo apt-get install subversion build-essential python-dev python-pmw \
libglew-dev freeglut3-dev libpng-dev libfreetype6-dev
libglew-dev freeglut3-dev libpng-dev libfreetype6-dev
 
# gcc 4.5 broken for install in ubuntu
# gcc 4.5 broken for install in ubuntu
sudo apt-get install gcc-4.4 g++-4.4
sudo apt-get install gcc-4.4 g++-4.4
export CC=/usr/bin/gcc-4.4
export CC=/usr/bin/gcc-4.4
 
svn co https://pymol.svn.sourceforge.net/svnroot/pymol/trunk/pymol $pymolsvn
svn co https://pymol.svn.sourceforge.net/svnroot/pymol/trunk/pymol $pymolsvn
 
modules=$pymoldir/modules
modules=$pymoldir/modules
cd $pymolsvn
cd $pymolsvn
python setup.py build install \
python setup.py build
    --home=$pymoldir \
python setup.py install
    --install-purelib=$modules \
python setup.py install --home=$pymoldir --install-purelib=$modules --install-platlib=$modules
    --install-platlib=$modules
 
export PYTHONPATH=$modules:$PYTHONPATH
export PYTHONPATH=$modules:$PYTHONPATH
sudo python setup2.py install
python setup2.py install
install $pymolsvn/pymol $pymoldir/
install $pymolsvn/pymol $pymoldir/
   
   
Line 143: Line 141:
echo "import sys" >> ~/.pymolrc
echo "import sys" >> ~/.pymolrc
echo "sys.path.append($t$pymoldir/wikiscripts$t)" >> ~/.pymolrc
echo "sys.path.append($t$pymoldir/wikiscripts$t)" >> ~/.pymolrc
 
########## Setup freemol - for MPEG support ############
########## Setup freemol - for MPEG support ############
[ -d $pymolsvn ] || mkdir $freemolsvn
[ -d $pymolsvn ] || mkdir $freemolsvn
svn co svn://bioinformatics.org/svnroot/freemol/trunk $freemolsvn
svn co svn://bioinformatics.org/svnroot/freemol/trunk $freemolsvn
 
cd $freemolsvn/src/mpeg_encode
cd $freemolsvn/src/mpeg_encode
export FREEMOL=$freemolsvn/freemol
export FREEMOL=$freemolsvn/freemol
Line 153: Line 151:
make
make
make install
make install
 
## Make a shortcut to export freemol and then execute pymol
## Make a shortcut to export freemol and then execute pymol
echo '#!/bin/bash' >> $pymoldir/pymolMPEG.sh
echo '#!/bin/bash' >> $pymoldir/pymolMPEG.sh
echo "export FREEMOL=$freemolsvn/freemol" >> $pymoldir/pymolMPEG.sh
echo "export FREEMOL=$freemolsvn/freemol" >> $pymoldir/pymolMPEG.sh
echo "#$pymoldir/pymol" >> $pymoldir/pymolMPEG.sh
echo "#$pymoldir/pymol" >> $pymoldir/pymolMPEG.sh
less $pymoldir/pymol >> $pymoldir/pymolMPEG.sh
tail -n +2 $pymoldir/pymol >> $pymoldir/pymolMPEG.sh
chmod u+x $pymoldir/pymolMPEG.sh  
chmod u+x $pymoldir/pymolMPEG.sh  
 
## Make a link, so we can call execute pymol
## Make a link, so we can call execute pymol
sudo ln -s $pymoldir/pymolMPEG.sh /usr/bin/pymol
sudo ln -s $pymoldir/pymolMPEG.sh /usr/bin/pymol
</source>
</source>
Execute the install commands, and you will be good to go with MPEG support
<source lang="bash">
./installpymol.sh
./pymolMPEG.sh
</source>


[[Category:Installation|Linux Installation]]
[[Category:Installation|Linux Installation]]

Revision as of 08:17, 15 November 2011

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:

# Debian/Ubuntu
sudo apt-get install pymol

# Fedora
yum install pymol

# Gentoo
emerge -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

On many Linux systems, one of the following commands installs all requirements:

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

# Fedora
yum install subversion python-devel freeglut-devel freetype-devel tkinter python-pmw

# Gentoo
emerge -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://pymol.svn.sourceforge.net/svnroot/pymol/trunk/pymol 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

python setup.py build install \
    --home=$prefix \
    --install-purelib=$modules \
    --install-platlib=$modules

export PYTHONPATH=$modules:$PYTHONPATH
python setup2.py install
install pymol $prefix/

Now launch PyMOL like this (you may copy this launcher into your $PATH, like to /usr/local/bin):

/opt/pymol-svn/pymol

Problems

  • gcc-4.5 is broken for pymol install, use gcc-4.4 (Mint11 Linux, PyMOL 1.4.1, 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 run the additional command
python setup2.py install pmw
to install a copy of the Python MegaWidgets.

Ubuntu/Mint Compile and install with MPEG support

Make a text file "installpymol.sh" and make it executable

chmod u+x installpymol.sh

Put this in the file, modify the first 3 lines

#!/bin/bash -e
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
python setup.py install
python setup.py install --home=$pymoldir --install-purelib=$modules --install-platlib=$modules
export PYTHONPATH=$modules:$PYTHONPATH
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