This is a read-only mirror of pymolwiki.org

Difference between revisions of "MAC Install"

From PyMOL Wiki
Jump to navigation Jump to search
m (2 revisions)
 
(101 intermediate revisions by 18 users not shown)
Line 1: Line 1:
[[Category:Installation|Mac]]
+
This page describes how to install PyMOL on Mac OS X.
http://images.apple.com/powermac/images/solutionsscience20050427.jpg
 
 
 
__TOC__
 
 
 
=Installing MacPyMOL=
 
http://delsci.com/macpymol/macpymol350.jpg
 
 
 
===Essentials===
 
  
The [http://delsci.com/macpymol/ download] is about as straightforward as it gets, and you can install it wherever it makes you happy. You need a 3 button mouse (clickable scroll wheel = middle button). Apple has finally come to its senses and designed a proper, ergonomically pleasant, [http://www.apple.com/mightymouse/ scrollbutton mouse] that works well with pymol and permits horizontal scrolling.  Most other mice will also work well.
+
== Incentive PyMOL ==
  
One word of warning: '''Do not install 3rd party drivers''' for multi-button mice if you can avoid it. These often mess with the mapping of the middle button or have other horrific side effects.  Fortunately, with OS X, you should not need to.
+
[http://www.schrodinger.com Schrödinger] provides pre-compiled 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.
  
I ([[User:Wgscott|Bill Scott]]) wrote a [http://xanana.ucsc.edu/Library/init/zsh/local-functions/xtal/pymol pymol] shell script (and zsh function) to invoke this on the command line. It uses mdfind to find the executable that lives in MacPyMOL.app/Contents/MacOS/PyMOL and pass arguments to it.
+
Download: https://pymol.org/
  
===Extras===
+
Installation: Drag '''PyMOL.app''' on the '''/Applications''' shortcut. (In principle, you could drag it into any Finder window and run it from there, it doesn’t have to live in /Applications).
  
You don't need any of these to use MacPyMOL.  But you didn't really '''need''' a Mac either.  Face it: You need these.
+
Uninstallation: Move '''/Applications/PyMOL.app''' to Trash
  
====Mighty Mouse====
+
=== Launching from Command Line ===
  
http://images.apple.com/mightymouse/images/index360scroll220050802.gif
+
The unix executable resides at '''/Applications/PyMOL.app/Contents/MacOS/PyMOL'''
  
A 3-button mouse is essential.  [http://www.apple.com/mightymouse/ Apple's Mighty Mouse] is an extra treat.
+
=== X11 Hybrid ===
  
====PowerMate Dial====
+
''Applies to PyMOL 1.x, not to PyMOL 2.x''
  
http://www.griffintechnology.com/images/products/prod_powermate_a.jpg
+
MacPyMOL can optionally run with the same two-window GUI which PyMOL uses on Windows and Linux. This GUI has some additional features, like the [[Plugins|Plugin]] menu and the [[Builder]].
  
The [http://www.chemistry.ucsc.edu/~wgscott/xtal/powermate_pymol_osx.html PowerMate dial works nicely with pymol].
+
Requires [http://xquartz.macosforge.org/ XQuartz].
  
====Stereo====
+
There are two ways to launch the X11 interface:
 +
# Rename or copy/duplicate '''/Applications/MacPyMOL.app''' to '''/Applications/MacPyMOLX11Hybrid.app''' or to '''/Applications/PyMOLX11Hybrid.app'''
 +
# Launch the unix executable with the '''-m''' flag: '''/Applications/MacPyMOL.app/Contents/MacOS/MacPyMOL -m'''
  
http://images.apple.com/powermac/images/graphicspymol20051018.jpg
+
=== Stereo on Second Monitor ===
 +
The trick to getting MacPyMOL to work in stereo on the second monitor is to force it to initially open on that display by providing an appropriate "-X #" (and perhaps -Y #) option on launch.  That way the OpenGL context will be created with stereo support.
 +
<source lang="python">
 +
./MacPyMOL.app/Contents/MacOS/MacPyMOL -X -1000
 +
./MacPyMOL.app/Contents/MacOS/MacPyMOL -X -1000 -Y 100
 +
</source>
  
The [http://www.apple.com/powermac/upgrade.html latest Macs] finally support [http://www.apple.com/powermac/graphics.html stereo in a window].  There is more information in the [[Monitors Hardware Options]] section.
+
'''Source:''' [https://sourceforge.net/p/pymol/mailman/message/11671952/ Warren DeLano; PyMOL Users Archive]
  
=Installing X-windows based pymol on Mac OS X=
+
== Open-Source PyMOL ==
  
===Why would you want to do this?===
+
=== Package managers ===
  
#You want to run a [http://www.oreilly.com/openbook/freedom/ free], guilt-free, open-source version of pymol
+
Open-Source PyMOL is available [https://github.com/schrodinger/pymol-open-source/blob/master/LICENSE free of charge] and may be readily installed via the [http://brew.sh/ Homebrew] (recommended), [https://www.macports.org/ MacPorts], or [http://www.finkproject.org/ Fink] package managers.
#You just happen to prefer the [http://wiki.python.org/moin/TkInter tkinter] menu
 
#You want to use [http://pymol.sourceforge.net/plugins.html plugins], for example, the [http://www-personal.umich.edu/~mlerner/PyMOL/  apbs plugin] for free grasp-like electrostatic calculations.
 
  
----
+
<source lang="bash">
 +
# Homebrew (recommended)
 +
brew install brewsci/bio/pymol
  
===Simplest Installation===
+
# Fink
 +
fink install pymol-py27
  
====Install pymol with Fink====
+
# MacPorts
http://pdb.finkproject.org/img/mlogo.png
+
sudo port install pymol
 +
</source>
  
By far the simplest way to install the X-windows based version of pymol on OS X is by using the [http://fink.sourceforge.net/ fink package management system].  To compile it, all you need to do is issue the command
+
You may need to make sure that the dependencies are installed with the required flags, e.g. for MacPorts:
  
fink install pymol-py24
+
<source lang="bash">
+
# MacPorts
(This will install python2.4 in fink, along with an X-windows based tkinter. There are also versions that permit you to install pymol to interact with python2.3 and even python2.2.  Fink uses its own unix-type python installation, but you can trick pymol into using the aqua framework to get a prettier GUI after the fact.)
+
sudo port install tcl -corefoundation
 +
sudo port install tk -quartz
 +
</source>
  
The [http://pdb.finkproject.org/pdb/package.php/pymol-py24 fink pymol package] currently exists in the unstable branch of fink, so you will either have to activate the unstable branch or make the following symbolic links:
+
If PyMOL complains that it wasn't able to find X11, try starting xquartz first, then run pymol from the console.
  
sudo ln -s /sw/fink/dists/unstable/main/finkinfo/sci/pymol-py.* /sw/fink/dists/local/main/finkinfo/.
+
=== Install from Source ===
 
You might need to create the latter directory if it doesn't already exist, i.e., issue the command
 
  
sudo mkdir -p /sw/fink/dists/local/main/finkinfo
+
If you want the latest PyMOL code (warning: might include experimental changes), then follow the [[Linux_Install#Install_from_source|Linux installation instructions]]. You will need an environment like Fink, MacPorts or Homebrew to install the dependencies. Make sure you use the appropriate python interpreter (e.g. '''/sw/bin/python2.7''' when using Fink).
  
 +
To run PyMOL with a native PyQt library (linked against macOS OpenGL framework, not against XQuartz), it needs to be built with the <code>--osx-frameworks</code> option:
  
I ([[User:wgscott|wgscott]]) have put a whole lot of further information on how to use fink to install crystallographic software on my own [http://xanana.ucsc.edu/~wgscott/xtal/wiki/index.php/Main_Page wiki] and [http://chemistry.ucsc.edu/~wgscott/xtal/ website], including instructions on [http://xanana.ucsc.edu/~wgscott/xtal/wiki/index.php/Getting_your_fink_installation_to_use_packages_that_I_have_pre-compiled how to install precompiled binary packages using fink].
+
<source lang="bash">
 +
python setup.py --osx-frameworks install
 +
</source>
  
The [http://pdb.finkproject.org/pdb/search.php?summary=pymol fink pymol package] is currently maintained by Jack Howarth.
+
=== Install APBS with Fink ===
  
====Install APBS and friends with fink====
+
To use the electrostatics plugin, you will need [http://apbs.sourceforge.net/ APBS] and its dependencies.  These are also available as Fink packages, and include [http://pdb.finkproject.org/pdb/package.php/apbs APBS], [http://pdb.finkproject.org/pdb/package.php/maloc maloc] and [http://pdb.finkproject.org/pdb/package.php/pdb2pqr pdb2pqr]. If you have multiple processors available, you might wish to install the [http://pdb.finkproject.org/pdb/package.php/apbs-mpi-openmpi MPI version of APBS].
 
 
To use the electrostatics plugin, you will need [http://apbs.sourceforge.net/ APBS] and its dependencies.  These are also available as fink packages, and include [http://pdb.finkproject.org/pdb/package.php/apbs apbs], [http://pdb.finkproject.org/pdb/package.php/maloc maloc] and [http://pdb.finkproject.org/pdb/package.php/pdb2pqr pdb2pqr]. If you have multiple processors available, you might wish to install the [http://pdb.finkproject.org/pdb/package.php/apbs-mpi mpi version of apbs].
 
  
 
Issuing the command
 
Issuing the command
Line 79: Line 81:
 
  fink install apbs
 
  fink install apbs
  
will install apbs and its required dependencies for you.  The fink pymol package is already preconfigured to do the right thing to use apbs as a plugin. Here is [http://www.chemistry.ucsc.edu/%7Ewgscott/xtal/pymol_screenshot.png a big screenshot of the fink APBS package being invoked via the pymol plugin].
+
will install apbs and its required dependencies for you.  The fink pymol package is already preconfigured to do the right thing to use apbs as a plugin.
  
'''Nucleic acids''' may prove problematic for the apbs plugin. If so, use the pdb2pqr command-line tool to create a pqr file manually, instead of using the plugin to generate it.
+
=== Stereo issues ===
 +
Some older Macs seem to crash with stereo graphics. If this happens to you, a workaround is to launch PyMOL explicitly in Mono mode with `pymol -M`.  You can also set up an alias in your ~/.profile:
  
----
+
alias pymol='pymol -M'
  
===Gratuitous Eye-Candy Tweaks===
+
== See Also ==
[[Image:snap_mac.png]]
 
  
You can get the fink installed X-windows based pymol-py24 to use an aqua-based tkinter menu as follows:
+
* [[pymolrc]]
 +
* [[Linux Install]]
 +
* [[Windows Install]]
 +
* [[MovieSchool_6#Exporting_your_Movie|FreeMOL installation for MPEG movie export]]
 +
* [[User:Wgscott|Bill Scott’s]] [[MacOSX-specific .pymolrc file]] and his crystallographic software [http://xanana.ucsc.edu/~wgscott/xtal/wiki/index.php/Main_Page wiki] and [http://chemistry.ucsc.edu/~wgscott/xtal/ website], including instructions on [http://xanana.ucsc.edu/~wgscott/xtal/wiki/index.php/Getting_your_fink_installation_to_use_packages_that_I_have_pre-compiled how to install precompiled binary packages using fink].
 +
* [[Launching_PyMOL#MacOS_X]]
  
1. Install a Framework build of Python2.4 as follows:
+
[[Category:Installation|Mac]]
 
+
[[Category:Nucleic_Acids|MAC Install]]
mkdir src
+
[[Category:Technical Issues|MAC Install]]
cd src
+
[[Category:Mac|MAC Install]]
curl -O http://www.python.org/ftp/python/2.4.2/Python-2.4.2.tgz
 
tar xvfz Python-2.4.2.tgz
 
cd Python-2.4.2
 
export PATH=/usr/bin:$PATH
 
./configure --enable-framework
 
make
 
sudo make frameworkinstall
 
 
 
2. Remove the following empty directory by issuing the command
 
 
 
sudo rmdir /Library/Frameworks/Python.framework/Versions/Current/lib/python2.4/site-packages
 
 
 
3. Make a symbolic link to your fink site-packages directory:
 
 
 
sudo ln -s /Library/Frameworks/Python.framework/Versions/Current/lib/python2.4/site-packages /sw/lib/python2.4/site-packages
 
 
 
This enables your new framework python to use all of the extras, like pmw, that you installed as dependencies for pymol.
 
 
 
4. Edit the file /sw/bin/python, and change the line
 
 
 
/sw/bin/python2.4 $PYMOL_PATH/modules/pymol/__init__.py "$@"
 
 
 
to
 
 
 
/Library/Frameworks/Python.framework/Versions/Current/bin/python2.4  $PYMOL_PATH/modules/pymol/__init__.py "$@"
 
 
 
5.  Now issue
 
 
 
/sw/bin/pymol
 
 
 
and you should see something that looks like this full-size [http://www.chemistry.ucsc.edu/%7Ewgscott/xtal/pymol_screenshot.png screenshot of pymol with an aqua-tkinter pmw GUI] and X-windows based molecular display window. Also shown in this screenshot is the APBS plugin in action.
 
 
 
 
 
===PyMOLX11Hybrid===
 
 
 
MacPyMOL for Tiger now includes a hybrid X11 mode. Assuming that X11 is already installed, simply duplicate MacPyMOL.app and rename it "PyMOLX11Hybrid.app" and launch.
 
 
 
Doing this creates the inverse situation of the previous tweak; the molecular viewer window is aqua-based and the tkinter GUI is X11 based.  (Naturally, I had to try the trick of making an aqua-tkinter GUI. It sort of works, but the GUI is dead, thanks to a threading bug in the aqua Tcl/Tk framework that comes with Apple.  Bummer.)
 

Latest revision as of 04:22, 12 November 2018

This page describes how to install PyMOL on Mac OS X.

Incentive PyMOL

Schrödinger provides pre-compiled 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/

Installation: Drag PyMOL.app on the /Applications shortcut. (In principle, you could drag it into any Finder window and run it from there, it doesn’t have to live in /Applications).

Uninstallation: Move /Applications/PyMOL.app to Trash

Launching from Command Line

The unix executable resides at /Applications/PyMOL.app/Contents/MacOS/PyMOL

X11 Hybrid

Applies to PyMOL 1.x, not to PyMOL 2.x

MacPyMOL can optionally run with the same two-window GUI which PyMOL uses on Windows and Linux. This GUI has some additional features, like the Plugin menu and the Builder.

Requires XQuartz.

There are two ways to launch the X11 interface:

  1. Rename or copy/duplicate /Applications/MacPyMOL.app to /Applications/MacPyMOLX11Hybrid.app or to /Applications/PyMOLX11Hybrid.app
  2. Launch the unix executable with the -m flag: /Applications/MacPyMOL.app/Contents/MacOS/MacPyMOL -m

Stereo on Second Monitor

The trick to getting MacPyMOL to work in stereo on the second monitor is to force it to initially open on that display by providing an appropriate "-X #" (and perhaps -Y #) option on launch. That way the OpenGL context will be created with stereo support.

./MacPyMOL.app/Contents/MacOS/MacPyMOL -X -1000
./MacPyMOL.app/Contents/MacOS/MacPyMOL -X -1000 -Y 100

Source: Warren DeLano; PyMOL Users Archive

Open-Source PyMOL

Package managers

Open-Source PyMOL is available free of charge and may be readily installed via the Homebrew (recommended), MacPorts, or Fink package managers.

# Homebrew (recommended)
brew install brewsci/bio/pymol

# Fink
fink install pymol-py27

# MacPorts
sudo port install pymol

You may need to make sure that the dependencies are installed with the required flags, e.g. for MacPorts:

# MacPorts
sudo port install tcl -corefoundation
sudo port install tk -quartz

If PyMOL complains that it wasn't able to find X11, try starting xquartz first, then run pymol from the console.

Install from Source

If you want the latest PyMOL code (warning: might include experimental changes), then follow the Linux installation instructions. You will need an environment like Fink, MacPorts or Homebrew to install the dependencies. Make sure you use the appropriate python interpreter (e.g. /sw/bin/python2.7 when using Fink).

To run PyMOL with a native PyQt library (linked against macOS OpenGL framework, not against XQuartz), it needs to be built with the --osx-frameworks option:

python setup.py --osx-frameworks install

Install APBS with Fink

To use the electrostatics plugin, you will need APBS and its dependencies. These are also available as Fink packages, and include APBS, maloc and pdb2pqr. If you have multiple processors available, you might wish to install the MPI version of APBS.

Issuing the command

fink install apbs

will install apbs and its required dependencies for you. The fink pymol package is already preconfigured to do the right thing to use apbs as a plugin.

Stereo issues

Some older Macs seem to crash with stereo graphics. If this happens to you, a workaround is to launch PyMOL explicitly in Mono mode with `pymol -M`. You can also set up an alias in your ~/.profile:

alias pymol='pymol -M'

See Also