This is a read-only mirror of pymolwiki.org
Difference between revisions of "Linux Install"
Line 133: | Line 133: | ||
svnfreemol=svnfreemol | svnfreemol=svnfreemol | ||
pymolplugins=pymolplugins | pymolplugins=pymolplugins | ||
+ | pymolscriptrepo=Pymol-script-repo | ||
################################################### | ################################################### | ||
[ -d $HOME/Software ] || mkdir $HOME/Software | [ -d $HOME/Software ] || mkdir $HOME/Software | ||
[ -d $pymoldir ] || mkdir $pymoldir | [ -d $pymoldir ] || mkdir $pymoldir | ||
+ | [ -d $HOME/bin ] || mkdir $HOME/bin | ||
+ | [ -d $HOME/pymol ] || mkdir $HOME/pymol | ||
− | |||
− | |||
− | |||
# Checkout svn | # Checkout svn | ||
svn co https://pymol.svn.sourceforge.net/svnroot/pymol/trunk/pymol $pymoldir/$svnpymol | svn co https://pymol.svn.sourceforge.net/svnroot/pymol/trunk/pymol $pymoldir/$svnpymol | ||
Line 167: | Line 167: | ||
## Make a link, so we execute pymol with the freemol env exported | ## Make a link, so we execute pymol with the freemol env exported | ||
− | + | ln -s $pymoldir/pymolMPEG.sh $HOME/bin/pymol | |
########## Install PluginArchitecture ############ | ########## Install PluginArchitecture ############ | ||
− | |||
git clone https://github.com/speleo3/pymolplugins.git $pymoldir/$pymolplugins | git clone https://github.com/speleo3/pymolplugins.git $pymoldir/$pymolplugins | ||
t="'" | t="'" | ||
− | echo "import sys" >> | + | echo "import sys" >> $pymoldir/.pymolrc.py |
− | echo "sys.path.append($t$pymoldir$t)" >> | + | echo "sys.path.append($t$pymoldir$t)" >> $pymoldir/.pymolrc.py |
− | echo "import $pymolplugins" >> | + | echo "import $pymolplugins" >> $pymoldir/.pymolrc.py |
+ | |||
+ | ########## Install Pymol-script-repo ############ | ||
+ | git clone git://github.com/Pymol-Scripts/Pymol-script-repo.git $pymoldir/$pymolscriptrepo | ||
+ | echo "import sys,os" >> $pymoldir/.pymolrc | ||
+ | echo "sys.path.append($t$pymoldir/$pymolscriptrepo$t)" >> $pymoldir/.pymolrc | ||
+ | echo "os.environ['PYMOL_GIT_MOD']=$t$pymoldir/$pymolscriptrepo/modules$t" >> $pymoldir/.pymolrc | ||
+ | echo "import plugins" >> $pymoldir/.pymolrc | ||
+ | echo "os.chdir($t$HOME/pymol$t)" >> $pymoldir/.pymolrc | ||
+ | |||
+ | ########## Make links ############ | ||
+ | ln -s $pymoldir/.pymolrc.py $HOME/.pymolrc.py | ||
+ | ln -s $pymoldir/.pymolrc $HOME/.pymolrc | ||
</source> | </source> | ||
Line 194: | Line 205: | ||
svnfreemol=svnfreemol | svnfreemol=svnfreemol | ||
pymolplugins=pymolplugins | pymolplugins=pymolplugins | ||
− | + | pymolscriptrepo=Pymol-script-repo | |
+ | |||
svn up $pymoldir/$svnpymol | svn up $pymoldir/$svnpymol | ||
svn up $pymoldir/$svnfreemol | svn up $pymoldir/$svnfreemol | ||
cd $pymoldir/$pymolplugins | cd $pymoldir/$pymolplugins | ||
+ | git pull | ||
+ | cd $pymoldir/$pymolscriptrepo | ||
git pull | git pull | ||
Revision as of 07:24, 27 January 2012
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/Mint
sudo apt-get install pymol
# Fedora
su -c 'yum install pymol'
# Gentoo
su -c 'emerge -av pymol'
# openSUSE (12.1 and later)
sudo zypper install pymol
# CentOS with EPEL
rpm -i http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
su -c 'yum --enablerepo=epel install 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/Mint
sudo apt-get install subversion build-essential python-dev python-pmw \
libglew-dev freeglut3-dev libpng-dev libfreetype6-dev
# Fedora/CentOS
su -c 'yum install subversion python-devel freeglut-devel freetype-devel tkinter python-pmw'
# Gentoo
sudo -c 'emerge -av dev-vcs/subversion dev-lang/python dev-python/pmw media-libs/glew \
media-libs/freeglut media-libs/libpng media-libs/freetype'
# openSUSE
sudo zypper install python-devel freeglut-devel gcc-c++ glew-devel libpng-devel python-pmw subversion
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
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)
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.
- If you're using Ubuntu 11.10 with an Intel Sandy Bridge video card and get graphics oddities. Please see Intel Driver Post for Ubuntu.
Ubuntu/Mint 12 compile and install with MPEG support
First install dependencies.
sudo yum install subversion git
sudo yum install python-imaging python-pygame apbs
sudo apt-get install build-essential python-dev python-pmw libglew-dev freeglut3-dev libpng-dev libfreetype6-dev
Make a text file "installpymol.sh" and make it executable
chmod u+x installpymol.sh
Put this in the file, modify the first line
#!/bin/bash -e
pymoldir=$HOME/Software/pymol
modules=$pymoldir/modules
svnpymol=svnpymol
svnfreemol=svnfreemol
pymolplugins=pymolplugins
pymolscriptrepo=Pymol-script-repo
###################################################
[ -d $HOME/Software ] || mkdir $HOME/Software
[ -d $pymoldir ] || mkdir $pymoldir
[ -d $HOME/bin ] || mkdir $HOME/bin
[ -d $HOME/pymol ] || mkdir $HOME/pymol
# Checkout svn
svn co https://pymol.svn.sourceforge.net/svnroot/pymol/trunk/pymol $pymoldir/$svnpymol
# Build and install pymol
cd $pymoldir/$svnpymol
python setup.py build install --home=$pymoldir --install-purelib=$modules --install-platlib=$modules
export PYTHONPATH=$modules:$PYTHONPATH
python setup2.py install
install pymol $pymoldir/
########## Setup freemol - for MPEG support ############
svn co svn://bioinformatics.org/svnroot/freemol/trunk $pymoldir/$svnfreemol
cd $pymoldir/$svnfreemol/src/mpeg_encode
export FREEMOL=$pymoldir/$svnfreemol/freemol
./configure
make
make install
## Make a shortcut to set env for freemol and then execute pymol
echo '#!/bin/bash' >> $pymoldir/pymolMPEG.sh
echo "export FREEMOL=$pymoldir/$svnfreemol/freemol" >> $pymoldir/pymolMPEG.sh
tail -n +2 $pymoldir/pymol >> $pymoldir/pymolMPEG.sh
chmod u+x $pymoldir/pymolMPEG.sh
## Make a link, so we execute pymol with the freemol env exported
ln -s $pymoldir/pymolMPEG.sh $HOME/bin/pymol
########## Install PluginArchitecture ############
git clone https://github.com/speleo3/pymolplugins.git $pymoldir/$pymolplugins
t="'"
echo "import sys" >> $pymoldir/.pymolrc.py
echo "sys.path.append($t$pymoldir$t)" >> $pymoldir/.pymolrc.py
echo "import $pymolplugins" >> $pymoldir/.pymolrc.py
########## Install Pymol-script-repo ############
git clone git://github.com/Pymol-Scripts/Pymol-script-repo.git $pymoldir/$pymolscriptrepo
echo "import sys,os" >> $pymoldir/.pymolrc
echo "sys.path.append($t$pymoldir/$pymolscriptrepo$t)" >> $pymoldir/.pymolrc
echo "os.environ['PYMOL_GIT_MOD']=$t$pymoldir/$pymolscriptrepo/modules$t" >> $pymoldir/.pymolrc
echo "import plugins" >> $pymoldir/.pymolrc
echo "os.chdir($t$HOME/pymol$t)" >> $pymoldir/.pymolrc
########## Make links ############
ln -s $pymoldir/.pymolrc.py $HOME/.pymolrc.py
ln -s $pymoldir/.pymolrc $HOME/.pymolrc
Update script
To pull and update PyMOL, one can make this script
Make a text file "updatepymol.sh" and make it executable
chmod u+x updatepymol.sh
Put this in the file, modify the first line
#!/bin/bash -e
pymoldir=$HOME/Software/pymol
modules=$pymoldir/modules
svnpymol=svnpymol
svnfreemol=svnfreemol
pymolplugins=pymolplugins
pymolscriptrepo=Pymol-script-repo
svn up $pymoldir/$svnpymol
svn up $pymoldir/$svnfreemol
cd $pymoldir/$pymolplugins
git pull
cd $pymoldir/$pymolscriptrepo
git pull
cd $pymoldir/$svnpymol
python setup.py build install --home=$pymoldir --install-purelib=$modules --install-platlib=$modules
export PYTHONPATH=$modules:$PYTHONPATH
python setup2.py install
install pymol $pymoldir/
########## Setup freemol - for MPEG support ############
cd $pymoldir/$svnfreemol/src/mpeg_encode
export FREEMOL=$pymoldir/$svnfreemol/freemol
./configure
make
make install
## Make a shortcut to set env for freemol and then execute pymol
rm $pymoldir/pymolMPEG.sh
echo '#!/bin/bash' >> $pymoldir/pymolMPEG.sh
echo "export FREEMOL=$pymoldir/$svnfreemol/freemol" >> $pymoldir/pymolMPEG.sh
tail -n +2 $pymoldir/pymol >> $pymoldir/pymolMPEG.sh
chmod u+x $pymoldir/pymolMPEG.sh
Change MPEG settings
Change settings in
$HOME/Software/pymol/svnfreemol/freemol/libpy/freemol/mpeg_encode.py
For example, change in line 205:
FRAME_RATE 24
(Note, only legal values is allowed: 23.976, 24, 25, 29.97, 30, 50 ,59.94, 60)
Then restart PyMOL.