This is a read-only mirror of pymolwiki.org

Difference between revisions of "Linux Install"

From PyMOL Wiki
Jump to navigation Jump to search
(move Troels scripts to own page)
Line 12: Line 12:
  
 
# Fedora
 
# Fedora
su -c 'yum install pymol'
+
yum install pymol
  
 
# Gentoo
 
# Gentoo
su -c 'emerge -av pymol'
+
emerge -av pymol
  
 
# openSUSE (12.1 and later)
 
# openSUSE (12.1 and later)
Line 22: Line 22:
 
# CentOS with EPEL
 
# CentOS with EPEL
 
rpm -i http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
 
rpm -i http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
su -c 'yum --enablerepo=epel install pymol'
+
yum --enablerepo=epel install pymol
 
</source>
 
</source>
  
Line 49: Line 49:
  
 
# Fedora/CentOS
 
# Fedora/CentOS
su -c 'yum install subversion python-devel freeglut-devel freetype-devel tkinter python-pmw'
+
yum install subversion python-devel freeglut-devel freetype-devel tkinter python-pmw
  
 
# Gentoo
 
# Gentoo
sudo -c 'emerge -av dev-vcs/subversion dev-lang/python dev-python/pmw media-libs/glew \
+
emerge -av dev-vcs/subversion 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
  
 
# openSUSE
 
# openSUSE
Line 81: Line 81:
 
python setup.py build install \
 
python setup.py build install \
 
     --home=$prefix \
 
     --home=$prefix \
     --install-purelib=$modules \
+
     --install-lib=$modules
    --install-platlib=$modules
 
  
 
export PYTHONPATH=$modules:$PYTHONPATH
 
export PYTHONPATH=$modules:$PYTHONPATH
Line 99: Line 98:
  
 
* 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]])
 
* 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">
 
<source lang="bash">
 
sudo apt-get install build-essential gcc-4.4 g++-4.4
 
sudo apt-get install build-essential gcc-4.4 g++-4.4
 
export CC=/usr/bin/gcc-4.4
 
export CC=/usr/bin/gcc-4.4
 
</source>
 
</source>
 +
</div>
  
 
* If you get an error message "ImportError: No module named Pmw" and lack half of the user interface, then run the additional command  
 
* If you get an error message "ImportError: No module named Pmw" and lack half of the user interface, then run the additional command  
 +
<div style="margin-left: 2em;">
 
<source lang="bash">
 
<source lang="bash">
 
python setup2.py install pmw
 
python setup2.py install pmw
 
</source>
 
</source>
 
to install a copy of the Python MegaWidgets.
 
to install a copy of the Python MegaWidgets.
 +
</div>
  
 
* 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'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].
  
== Ubuntu/Mint 12 compile and install with MPEG support ==
+
== Customized Installations ==
First install dependencies.
 
<source lang="bash">
 
sudo apt-get install subversion git
 
sudo apt-get install python-imaging python-pygame apbs
 
sudo apt-get install build-essential python-dev python-pmw libglew-dev freeglut3-dev libpng-dev libfreetype6-dev
 
bash installpymol.sh
 
</source>
 
 
 
== Red Hat Enterprise Linux RHEL 6 compile and install with MPEG support for x86_64 bit ==
 
Install the EPEL repository: The .rpm will be download from here <br>
 
http://fedoraproject.org/wiki/EPEL <br>
 
And the CentOS repository for additional .rpm are located here <br>
 
http://mirror.centos.org/centos/6/os/x86_64/Packages/ <br>
 
<source lang="bash">
 
bash
 
cd && wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
 
sudo rpm -i epel-release-6-5.noarch.rpm
 
rm epel-release-6-5.noarch.rpm</pre>
 
</source>
 
Then add Centos repository
 
<source lang="bash">
 
rpm --import http://mirror.centos.org/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6
 
sudo gedit /etc/yum.repos.d/centos.repo
 
</source>
 
 
 
Write these lines.
 
<source lang="text">
 
[centos]
 
name=Centos for RHEL/ CentOS $releasever - $basearch
 
baseurl=http://mirror.centos.org/centos/6/os/x86_64
 
enabled=1
 
</source>
 
Then check configuration. Do NOT UPGRADE PACKAGES from CentOS. It will replace RHEL packages. <br>
 
If you do upgrade packages, you will now see Centos login and such, but not much is problematic.
 
<source lang="bash">
 
sudo yum repolist all
 
sudo yum install subversion git
 
sudo yum install python-imaging pygame apbs
 
sudo yum install gcc-c++ python-devel python-pmw glew-devel freeglut-devel libpng-devel freetype-devel
 
</source>
 
Then disable centos repository. Set '''enabled=0'''
 
<source lang="bash">
 
sudo gedit /etc/yum.repos.d/centos.repo
 
</source>
 
Now install pymol
 
<source lang="bash">
 
bash installpymol.sh
 
</source>
 
Make sure, that you will have '''~/bin''' as part of your path
 
<source lang="bash">
 
gedit ~/.cshrc
 
</source>
 
Make sure this lines is in the file. Only if you use tcsh shell.
 
<source lang="text">
 
setenv PATH ${PATH}:{$HOME}/bin
 
</source>
 
 
 
== Install script ==
 
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 line
 
<source lang="bash">
 
#!/bin/bash -e
 
pymoldir=$HOME/software/pymol
 
modules=$pymoldir/modules
 
svnpymol=svnpymol
 
svnfreemol=svnfreemol
 
pymolplugins=pymolplugins
 
pymolscriptrepo=Pymol-script-repo
 
 
###################################################
 
[ -d $pymoldir ] || mkdir -p $pymoldir
 
[ -d $HOME/bin ] || mkdir $HOME/bin
 
 
###### Checkout pymol 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
 
 
 
########## Install PluginArchitecture ############
 
git clone https://github.com/speleo3/pymolplugins.git $pymoldir/$pymolplugins
 
########## Install Pymol-script-repo ############
 
git clone git://github.com/Pymol-Scripts/Pymol-script-repo.git $pymoldir/$pymolscriptrepo
 
 
 
## Make a shortcut to an extended pymol execution
 
echo "#!/bin/bash" >> $pymoldir/pymolMPEG.sh
 
echo "if [ ! -f $HOME/.local/share/applications/pymolsvn.desktop ];" >> $pymoldir/pymolMPEG.sh
 
echo "then" >> $pymoldir/pymolMPEG.sh
 
echo "ln -s $pymoldir/pymolsvn.desktop $HOME/.local/share/applications/pymolsvn.desktop" >> $pymoldir/pymolMPEG.sh
 
echo "fi" >> $pymoldir/pymolMPEG.sh
 
echo "export FREEMOL=$pymoldir/$svnfreemol/freemol" >> $pymoldir/pymolMPEG.sh
 
echo "export PYMOL_GIT_MOD=$pymoldir/$pymolscriptrepo/modules" >> $pymoldir/pymolMPEG.sh
 
echo '#export PYTHONPATH=$PYTHONPATH:/path/to/shared/python/site-packages/PIL' >> $pymoldir/pymolMPEG.sh
 
echo '#export PYTHONPATH=$PYTHONPATH:/path/to/shared/python/site-packages/lib-dynload' >> $pymoldir/pymolMPEG.sh
 
echo "export PYTHONPATH=$pymoldir"':$PYTHONPATH' >> $pymoldir/pymolMPEG.sh
 
echo "export PYTHONPATH=$pymoldir/$pymolscriptrepo/modules"':$PYTHONPATH' >> $pymoldir/pymolMPEG.sh
 
echo "export PYTHONPATH=$pymoldir/$pymolscriptrepo"':$PYTHONPATH' >> $pymoldir/pymolMPEG.sh
 
echo "export PYMOL_PATH=$modules/pymol/pymol_path" >> $pymoldir/pymolMPEG.sh
 
echo '#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/shared/lib/pymollib' >> $pymoldir/pymolMPEG.sh
 
echo '#export LIBGL_ALWAYS_INDIRECT=no' >> $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
 
 
 
## Make a pymolsvn.desktop
 
echo "#!/bin/env xdg-open" >> $pymoldir/pymolsvn.desktop
 
echo "[Desktop Entry]" >> $pymoldir/pymolsvn.desktop
 
echo "Version=1.5.x" >> $pymoldir/pymolsvn.desktop
 
echo "Name=PyMOL Molecular Graphics System - Open source" >> $pymoldir/pymolsvn.desktop
 
echo "GenericName=Molecular Modeller" >> $pymoldir/pymolsvn.desktop
 
echo "Comment=Model molecular structures and produce high-quality images of them" >> $pymoldir/pymolsvn.desktop
 
echo "Type=Application" >> $pymoldir/pymolsvn.desktop
 
echo "Exec=env $pymoldir/pymolMPEG.sh" >> $pymoldir/pymolsvn.desktop
 
echo "Icon=$pymoldir/$pymolscriptrepo/files_for_examples/pymol.xpm" >> $pymoldir/pymolsvn.desktop
 
echo "MimeType=chemical/x-pdb" >> $pymoldir/pymolsvn.desktop
 
echo "Categories=Education;Science;Chemistry;" >> $pymoldir/pymolsvn.desktop
 
echo "Terminal=false" >> $pymoldir/pymolsvn.desktop
 
 
 
## Make a startup files, which is always executed on startup.
 
t="'"
 
echo "import sys,os" >> $modules/pymol/pymol_path/run_on_startup.py
 
echo "import $pymolplugins" >> $modules/pymol/pymol_path/run_on_startup.py
 
echo "pymolplugins.preferences = {'instantsave': False, 'verbose': False}" >> $modules/pymol/pymol_path/run_on_startup.py
 
echo "pymolplugins.autoload = {'apbs_tools': False}" >> $modules/pymol/pymol_path/run_on_startup.py
 
echo "pymolplugins.set_startup_path( [$t$pymoldir/$pymolscriptrepo/plugins$t,$t$modules/pmg_tk/startup$t] )" >> $modules/pymol/pymol_path/run_on_startup.py
 
echo "pymolplugins.preferences = {'instantsave': True, 'verbose': False}" >> $modules/pymol/pymol_path/run_on_startup.py
 
echo "pymolplugins.preferences['instantsave'] = True" >> $modules/pymol/pymol_path/run_on_startup.py
 
</source>
 
 
 
=== Change MPEG settings ===
 
Change settings in
 
<source lang="bash">
 
$HOME/Software/pymol/svnfreemol/freemol/libpy/freemol/mpeg_encode.py
 
</source>
 
For example, change in line 205:<br>
 
FRAME_RATE 24<br>
 
(Note, 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]]

Revision as of 23:46, 2 March 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
yum install pymol

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

# 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-lib=$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.

Customized Installations