How to compile and install Pymol (windows & linux & MAC!) Updated to 1.8.2.0

This tuto explains how to install and compile the last version of Pymol on Windows and Linux.
News : updated to 1.8.2.0 for 64bit systems on 25/04/16

 


 

Windows (1.8.2.0):

Thanks to Christoph Gohlke from the Laboratory for Fluorescence Dynamics, University of California for the precompiled version of pymol available on his website (http://www.lfd.uci.edu/~gohlke/pythonlibs/)

For 64 bits (1.8.2.0):

  • Download and install Python 2.7.9 (and only python 2.7.9)

     

     

     

  • The compilation may fail if you don't have Virtual C++ compilator for Python : http://www.microsoft.com/en-us/download/details.aspx?id=44266
  • You will need the precompiled version of pymol made by Christoph Gohlke. It's not user friendly, so I made an archive with all the files and a batch script to install it automatically.

     

     

     

    • 64 bits computers:
    • Once you have installed Python, extract all the files from the archive. All the files needs to be on the same folder.
    • Run install_pymol.bat and voilà! Press a touch to close the windows
    • Now you can launch Pymol from C:/Python27/pymol.exe (default path).If Python is installed on another folder, go to [PYTHONFOLDER]/pymol.exe

For 32 Bits (1.7.5.0):

Since Pymol 1.8.0.0 is not available for 32 bits version, I will keep the 1.7.5.0 for 32bits.
NOTE  : On this version volume renderer (such as .dx maps) is not working with this version on windows. If you want this version you have to downgrade to the 1.7.0.0 or use the linux version, through virtual PC for exemple, or use the 64bit version if your system support it.
Almost the same as 64 bits :

  • Download and install Python 2.7.9 (and only python 2.7.9)

     

     

     

  • Virtual C++ compilator for Python : http://www.microsoft.com/en-us/download/details.aspx?id=44266
  • You will need the precompiled version of pymol made by Christoph Gohlke from the Laboratory for Fluorescence Dynamics, University of California. It's not user friendly, so I made an archive with all the files and a batch script to install it automatically.

     

     

     

    • 32 bits Computers:
    • Once you have installed Python, extract all the files from the archive. All the files needs to be on the same folder.
    • Run install_pymol.bat and voilà! Press a touch to close the windows
    • Now you can launch Pymol from C:/Python27/pymol.exe (default path).If Python is installed on another folder, go to [PYTHONFOLDER]/pymol.exe

NOTE : the last step of the pymol lib compilation may be long but it's normal!

NOTE 2 : If you have the error "Python not found"

Some of you have a issue with Python ("Python not found"). My script search the Python Path in the Windows Registry. If Python was not installed properly maybe the location in the registry will not be the same. In this case, I created 2 other archives with the default python path (" C:/Python27 ").

  • If you have this error and python is installed in this directory, you can use this new script and it will work!
  • If you have not installed python in this directory (the default one), you have to modify the script "install_pymol.bat". To do : just remplace " C:/Python27 " (without quote) by your current python directory (like " D:/softwares/python27 ").

 


Linux (1.8.2.0):

On linux, the installation is a little harder…. But I hope try to simplify it for you :). Good news for non root user! Most of packages needed for PyMOL compilation are usually already installed on Linux session. If not, you still can ask you admin to install it.

1 – Firstable: you need python, python-dev, python-pmw, numpy, freeglut3-dev, libglew-dev, libpng, libfreetype and to avoid to have issues during the compilation, install the build-essential package:

sudo apt-get install python python-dev python-pmw python-numpy freeglut3-dev libglew-dev libpng12-dev libfreetype6-dev build-essential libxml++2.6-dev

2 – Download Pymol source and extract it:

wget http://sourceforge.net/projects/pymol/files/latest/download -O pymol_source.tar.bz2&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br />
	tar -xvf pymol_source.tar.bz2&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br />
	cd pymol 

3 – Prepare your installation folder (for me : ~/Softwares/Pymol/) but you can change it.

mkdir -p ~/Softwares/Pymol/&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br />
	prefix=~/Softwares/Pymol&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br />
	modules=$prefix/modules

4 – build  and install PyMOL:

 python setup.py build install --home=$prefix --install-lib=$modules --install-scripts=$prefix

5 – Grab a coffee, it can take a while…

6 – Normally, you will have a pymol executable into ~/Software/Pymol. If not check section Issues (bottom of the page).

7 – If you want to run pymol simply by using the "pymol" command you can:

  • If you are root : put the pymol executable in your /usr/bin folder

     

     

     

     sudo cp ~/Softwares/Pymol/pymol /usr/bin/pymol 

  • If you are not root: create a alias :

     

     

     

    echo 'alias pymol="~/Softwares/Pymol/pymol"' > ~/.bashrc

    Then close and re-open a terminal or:

     source ~/.bashrc 

 

Issues on LINUX

If you don't have a "pymol" executable in your $prefix folder (or pymol folder if you just run python setup.py build install), try these:
  • If it's not working : check if you have really installed the build-essential package:

     

     

     

     sudo apt-get install build-essential 

  • If you have an error with this line : "error: command 'x86_64-linux-gnu-gcc' failed with exit status 1" (you may have a lot of texte during the compilation, so you have to look weel). It's because you gcc compilator is set to consider warning like errors. Try :

     

     

     

     export CFLAGS="-Wno-error" 

  • If you have another error like :

     

     

     

     export CFLAGS="-std=gnu++0x" 

    or :

     export CFLAGS="-Wno-error -std=gnu++0x" 

  • If you have other issues (error like "pymol is a directories", cc1 errors etc…) : try to delete Pymol folder, and extract again the pymol archive (try again from step 2).
  • If it's not working too… I don't know.. You can send me an email through the Contact page with your error message. I can't assure that I will fix it, but I will try and if I manage to do it, I will put the solution here.
  • If you see an error during the compilation (with the message "compilation terminated" or something like ("something.h not found"), it's maybe because one of the package needed is not installed. Try to run again the command on step 1.

 


MAC OSX (1.8.2.0):

Notes:

  • I don't own a mac and i'm not a MAC specialist…Theses commands was tested on a OSX 10.11 & 10.9  and you NEED fink installed.
    If some packages aren't available for you OSX version, I suggest you to use

 fink list | grep {PACKAGE_NAME} 

to replace glew1.3 if it's not available.
ex :

 fink list | grep glew 

  • Feel free to change installation directory and the pymol alias. It's only example commands.
  • You must be SUDO with theses commands (or install pymol on another directory than /Programs)!
  • You must have an Xquartz installed (or X11 depending your OS X version)

 

<br />
	sudo fink install python27 numpy-py27 pmw-py27 mesa mesa-shlibs system-pkgconfig-libpng15 freetype219 freetype219-shlibs freeglut2 freeglut2-shlibs glew1.13 glew1.13-shlibs wget tcltk-dev tcltk-shlibs<br />
	cd ~/Downloads/<br />
	wget http://sourceforge.net/projects/pymol/files/latest/download -O pymol_source.tar.bz2<br />
	tar xvf pymol_source.tar.bz2<br />
	cd pymol<br />
	sudo mkdir -p /Programs/Pymol.app<br />
	prefix=/Programs/Pymol.app<br />
	modules=$prefix/modules<br />
	sudo /sw/bin/python2.7 setup.py build install --home=$prefix --install-lib=$modules --install-scripts=$prefix<br />
	echo &quot;alias pymol=&#39;/Programs/Pymol.app/pymol&#39;&quot; &gt;&gt; ~/.bash_profile<br />
	source ~/.bash_profile<br />
	

Issues :

  • If you have an error like "libpng warning: Application built with libpng-1.5.23 but running with 1.6.19" : it's because a more recent library of libpng (or other) was already installed.
  • You can remove the one you want with "fink remove [package_name]".

Have fun on Pymol 🙂
Thibault.

Avec mots-clefs , , , , .Lien pour marque-pages : permalien.

106 réactions à How to compile and install Pymol (windows & linux & MAC!) Updated to 1.8.2.0

  1. Pingback:Installing latest version of Pymol from source? - ubuntutextbook

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

 

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur comment les données de vos commentaires sont utilisées.