MAC Install: Difference between revisions

From PyMOLWiki
Jump to navigation Jump to search
(→‎Pre-compiled: Make Homebrew the recommended package manager)
 
(28 intermediate revisions by 7 users not shown)
Line 1: Line 1:
[[Category:Installation|Mac]]
This page describes how to install PyMOL on Mac OS X.
 
== Incentive PyMOL ==


__TOC__
[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.


=Installing MacPyMOL=
Download: https://pymol.org/
==Essentials==
The [http://pymol.org/dsc 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.
==Warning on Mouse Drivers==
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.
==Invoking pymol from the unix command line==
The unix executable resides at MacPyMOL.app/Contents/MacOS/MacPyMOL


I ([[User:Wgscott|Bill Scott]]) wrote a cheezy [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.  I also use [[MacOSX-specific .pymolrc file|this ~/.pymolrc]] file.
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).


Additional invokation options and further details are discussed under [[Launching_PyMOL#MacOS_X:]]
Uninstallation: Move '''/Applications/PyMOL.app''' to Trash


==Extras==
=== Launching from Command Line ===
You don't need any of these to use MacPyMOL.  But you didn't really '''need''' a Mac either.  Face it: You need these.
===Mighty Mouse / Magic Mouse===
http://images.apple.com/mightymouse/images/index360scroll220050802.gif


A 3-button mouse is essential.  [http://www.apple.com/mightymouse/ Apple's Mighty Mouse] is an extra treat.
The unix executable resides at '''/Applications/PyMOL.app/Contents/MacOS/PyMOL'''


The Mighty Mouse was superseded in late 2009 by the [http://en.wikipedia.org/wiki/Magic_Mouse Magic Mouse]. Although a great mouse with scrolling capability, the magic mouse is a 2-button mouse with gesture-enabled surface, and so it lacks a built-in middle button. To use it as-is, choose a 2 button mode in the Mouse menu.
=== X11 Hybrid ===


However, to enable 3-button usage on the Magic Mouse, one can download and install the third-party [http://magicprefs.com/ MagicPrefs] preference pane. On the "Clicks and Taps" tab, assign "One Finger Middle Axis Click" to the "Middle Click" option.
''Applies to PyMOL 1.x, not to PyMOL 2.x''


If using an X11 version of PyMOL on a Mac, one can also enable the "Emulate three button mouse" preference (X11 > Preferences > Input). In this case, pressing Option or Command in conjunction with a left-click results in middle-click or right-click behavior, respectively.
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]].


===Stereo===
Requires [http://xquartz.macosforge.org/ XQuartz].
http://images.apple.com/powermac/images/graphicspymol20051018.jpg


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.
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'''


===Second Monitor===
=== 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.
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">
<source lang="python">
Line 40: Line 34:
</source>
</source>


'''Source:''' ''Warren DeLano; PyMOL Users Archive''
'''Source:''' [https://sourceforge.net/p/pymol/mailman/message/11671952/ Warren DeLano; PyMOL Users Archive]
 
== Open-Source PyMOL ==


=PyMOL and Fink=
=== Package managers ===
Fink is a subsystem that was created to bring the full power of Linux open-source to the Darwin (Apple) platform.  It is essentially a full working Linux system integrated with the Apple OS.  Even X11 applications can be run.  To use PyMOL with fink, you will first need to install [http://fink.sourceforge.net/ fink].  This usually takes a while, but is straightforward.


Once fink is installed, you have two options: (1) use the PyMOL package setup by [[User:wgscott|wgscott]], which might be old, but easier to install; or, download the PyMOL source and build. As usual, it comes down to ease of install vs. new features.
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.


== PyMOL Directly from Fink ==
To install PyMOL directly from fink, type:
<source lang="bash">
<source lang="bash">
# Homebrew (recommended)
brew install brewsci/bio/pymol
# Fink
fink install pymol-py27
fink install pymol-py27
# MacPorts
sudo port install pymol
</source>
</source>


This will install python2.7 in fink, along with an X-windows based tkinter. There are also versions that permit you to install PyMOL to interact with python2.6 and older (as of Mar-12-2013).  Fink uses its own unix-type python installation. For other versions list up pymol packages using '''fink list pymol*''' on command line.
You may need to make sure that the dependencies are installed with the required flags, e.g. for MacPorts:


===Notes and Possible Issues ===
* The [http://pdb.finkproject.org/pdb/package.php/pymol-py25 fink pymol package] currently exists in the [http://fink.sourceforge.net/faq/usage-fink.php#unstable unstable branch of fink], so you will either have to [http://xanana.ucsc.edu/~wgscott/xtal/wiki/index.php/How_to_Activate_the_Unstable_Branch activate the unstable branch] or make the following symbolic links:
<source lang="bash">
<source lang="bash">
sudo ln -s /sw/fink/dists/unstable/main/finkinfo/sci/pymol-py.* /sw/fink/dists/local/main/finkinfo/.
# MacPorts
</source>
sudo port install tcl -corefoundation
You might need to create the latter directory if it doesn't already exist, i.e., issue the command
sudo port install tk -quartz
<source lang="bash">
sudo mkdir -p /sw/fink/dists/local/main/finkinfo
</source>
</source>
* 10.4 ONLY: Be sure to set your display environment in your start up shell script to use pymol.  For example in your home directory, the .bashrc (or .bash_profile) file should contain:
<source lang="bash">
export DISPLAY=":0.0"
</source>
Do NOT set the DISPLAY variable for 10.5+, as God does this for you automatically.  If for some reason you don't want to set DISPLAY, launch X11 manually (Applications/Utilities) then start a login shell with 'xterm -ls' (note default xterm is not a login shell so will not read .bashrc) and finally issue 'pymol'
* Fink pymol also reads ~/.pymolrc in your home directory.
* 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].


* The [http://pdb.finkproject.org/pdb/search.php?summary=pymol fink pymol package] is currently maintained by Jack Howarth.
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_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).


= PyMOL Install from Source, 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:
If the above didn't work, or you really want the latest PyMOL code, then:
* Download the latest PyMOL source and unpack it.
* Ensure that you have installed, in Fink:
** python-2.5 pmw-py25
** mesa mesa-shlibs
** libpng3 libpng3-shlibs
** freetype2 freetype2-deve
** freeglut freeglut-shlibs
* Change directory into the new PyMOL dir, eg. ''cd pymol''
* Then, install PyMOL with,
<source lang="bash">
/sw/bin/python setup.py install
</source>


==Notes and Possible Issues==
* If you get an error about '''-Wno-long-double''' then your gcc is mismatched.  I fixed this by pointing the symbolic link ''/usr/bin/gcc'' from ''/usr/bin/gcc-4.2'' to ''/usr/bin/gcc-4.0''.  Or, in code,
<source lang="bash">
<source lang="bash">
# These command are commented out to stop people from copy/pasting b/c
python setup.py --osx-frameworks install
# these are possibly dangerous for your system. Ensure that /usr/bin/gcc
# is a symbolic link and not a real binary.  If so, I used the following
# to fix the -Wno-long-double error.
# sudo rm /usr/bin/gcc
# sudo ln -s /usr/bin/gcc-4.0 /usr/bin/gcc
</source>
</source>
* If you get an error about something like ''GL_PALETTE_TEXTURE'' then you need to comment out those few lines in the code that throws the error.  Read the output.


==Install APBS and friends with fink==
=== Install APBS with Fink ===


[[Image:Rna_surface_apbs.png|thumb|APBS calculated electrostatic potential of SARS s2m RNA reveals the colors of a true patriot.]]
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-openmpi mpi version of apbs].


Issuing the command
Issuing the command
Line 111: 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://xanana.ucsc.edu/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:


=PyMOL in MacPorts=
  alias pymol='pymol -M'
Recent versions of [http://www.macports.org/ MacPorts] (at least 1.8.2) also include a hybrid PyMOL and also apbs. One can install it with
  sudo port install pymol apbs apbs-mpi
==Pymol from MacPorts using simple GUI approach==
# Install [http://guide.macports.org/#installing MacPorts], including Xcode Tools and X11 if necessary
# Install a MacPorts [http://trac.macports.org/wiki/FAQ#gui GUI client], for example [http://porticus.alittledrop.com/ Porticus]. Do a Selfupdate.
# Search for Pymol via gui and install
# Launch Terminal app and execute pymol
===Config issues===
* If you already have a .bash_profile, you may need to copy the lines which macports [http://guide.macports.org/#installing.shell installation puts in .profile] into .bash_profile
* Pymol installation in macports uses the subversion repository so you may need to configure the svn command line client [http://svnbook.red-bean.com/en/1.1/ch07.html#svn-ch-7-sect-1.3.1 config file] for your proxy settings in ~/.subversion/servers
* If the menu/control window does not appear when launching pymol and the terminal window reports "ImportError: No module named _tkinter", macports python may have installed without tkinter even if the no_tkinter option was not selected in the gui. To fix, uninstall python26 via gui then execute the following at the command line to force ignoring of no_tkinter.
sudo port install python26 -no_tkinter
==Troubleshooting==
; When selecting atoms with the mouse, no matter how well one aims, the atoms selected are actually those far from the ones wanted: This is a known problem.  Select "Millions of Colors" in '''System Preferences->Display'''.
; There seems to be a race condition between the Tk window and the openGL window.  (The focus for the windows are very quickly flashing back and forth.): This is a well-known problem.  The blame here is circular: Apple blames developers, developers blame Apple.  Regardless, it appears to have been fixed with the latest Mac OS X (10.6) release.  Upgrade to 10.6 and this problem goes away.
;When using multiple displays, the OpenGL window flickers; moving the window between displays crashes the whole session [https://trac.macports.org/ticket/24895]: If you don't need stereo then start PyMOL in mono mode with <pre>pymol -M</pre>If you need stereo then you probably need to wait for a fix in the graphics driver.


=PyMOL in brew=
== See Also ==
Install [http://mxcl.github.com/homebrew/ homebrew].
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
Install PyMOL
brew tap homebrew/science
brew install pymol
== Switch stereo ==
This installation switches the stereo/mono graphics paradigm.<br>
Recent builds of OSX with intel chips seem to crash with stereo graphics.<br>
Therefore, pymol defaults assumes the "-M" flag has been passed to it.<br>
You can switch to stereo graphics (if you know it won't crash your computer) with the "-S" flag.<br>
Alternatively, you can install pymol with original stereo graphics on as default by installing with
brew install pymol --default-stereo
== With xquartz intalled ==
For it to run well, you need to enable threads, do:
brew update
brew uninstall tcl
brew uninstall tk
brew uninstall python
brew install tk  --enable-threads
brew install tcl  --enable-threads
brew install python --with-brewed-tk


=Miscellaneous installation=
* [[pymolrc]]
===Exporting MPG movies===
* [[Linux Install]]
See [[MovieSchool_6#Exporting_your_Movie|MovieSchool 6]] for freemol installation.<BR>
* [[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]]


[[Category:Installation|Mac]]
[[Category:Nucleic_Acids|MAC Install]]
[[Category:Nucleic_Acids|MAC Install]]
[[Category:Technical Issues|MAC Install]]
[[Category:Technical Issues|MAC Install]]
[[Category:Mac|MAC Install]]
[[Category:Mac|MAC Install]]

Latest revision as of 13:05, 8 October 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