<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pymol.org/index.php?action=history&amp;feed=atom&amp;title=Launching_PyMOL</id>
	<title>Launching PyMOL - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pymol.org/index.php?action=history&amp;feed=atom&amp;title=Launching_PyMOL"/>
	<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Launching_PyMOL&amp;action=history"/>
	<updated>2026-05-06T16:21:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Launching_PyMOL&amp;diff=8055&amp;oldid=prev</id>
		<title>Pyadmin: 1 revision</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Launching_PyMOL&amp;diff=8055&amp;oldid=prev"/>
		<updated>2014-03-28T02:16:29Z</updated>

		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:16, 28 March 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Pyadmin</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Launching_PyMOL&amp;diff=8054&amp;oldid=prev</id>
		<title>Hongbo zhu: /* Windows */</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Launching_PyMOL&amp;diff=8054&amp;oldid=prev"/>
		<updated>2011-04-12T21:02:44Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Windows&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;PyMOL can be started from the command line or from a Python script.  Also, PyMOL has lots of [[Command_Line_Options|command line options]] that one can pass in to affect PyMOL's behavior.  For example, one can load a few proteins and even execute a script all from the commandline.  Also, there's a [[Pymolrc | .pymolrc]] file that initializes PyMOL each time PyMOL is executed.&lt;br /&gt;
&lt;br /&gt;
* More on launching PyMOL&lt;br /&gt;
**[[Command Line Options]]&lt;br /&gt;
**[[Launching From a Script]]&lt;br /&gt;
&lt;br /&gt;
=Invoking PyMOL and reading startup commands from a file=&lt;br /&gt;
==Linux==&lt;br /&gt;
Assuming the executable is in your '''$PATH''', simply issue&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
pymol&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
together with any [[Command_Line_Options]] and arguments (pdb files, pse files, map files and so forth) you require.&lt;br /&gt;
&lt;br /&gt;
Whenever PyMol starts, a user-created '~/.pymolrc' file containing commands is run. All you need to do is create &amp;quot;.pymolrc&amp;quot; and place it in your home directory. Alternatively, you can instead create &amp;quot;.pymolrc.py&amp;quot; which contains actual Python code instead of just PyMOL commands.  See an [[Inchoates_pymolrc|example .pymolrc]]).&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
On Windows, use 'pymolrc', 'pymolrc.py' or 'pymolrc.pym'.  For global defaults (all users), you can place a .pymolrc file in C:\Program Files\DeLano Scientific\PyMOL (or C:\Program Files\PyMOL\PyMOL).  You can launch PyMOL from the applications menu or from the icon on your desktop (if you placed one there).&lt;br /&gt;
&lt;br /&gt;
Alternatively, if you want to change the default directory for data, you can just put the path to the new default directory in the &amp;quot;Start In&amp;quot; field of the &amp;quot;shortcut link&amp;quot; that is used to launch Pymol.  To do this, right click on the &amp;quot;shortcut link&amp;quot; that is used to launch Pymol, click on &amp;quot;Properties&amp;quot; and then, in the &amp;quot;Start In&amp;quot; field, type in the path to the new default data directory.  Then click &amp;quot;OK&amp;quot; and the changes are complete.&lt;br /&gt;
&lt;br /&gt;
==MacOS X==&lt;br /&gt;
===Launching===&lt;br /&gt;
* Double-click the application's icon&lt;br /&gt;
* Issue the unix command &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;open -a MacPyMOL&amp;lt;/source&amp;gt;&lt;br /&gt;
* Directly invoking the unix executable &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;/Applications/MacPyMOL.app/Contents/MacOS/MacPyMOL&amp;lt;/source&amp;gt;&lt;br /&gt;
* If MacPyMOL is set as the default application to open pdb, pse and other such files, double-clicking any of those files (or issuing the unix open command) will start also pymol and load the file you clicked on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The third one assumes the application has been placed in '''/Applications''', so adjust the absolute path if you have it elsewhere.  If you directly invoke the unix executable to launch pymol, it has the advantage that you can pass [[Command_Line_Options]] and arguments to it in the usual way.  You might wish to '''make an alias''':&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
alias pymol=/Applications/Xtal/MacPyMOL.app/Contents/MacOS/MacPyMOL&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
(leave out the equal sign for tcsh) '''or [http://en.wikipedia.org/wiki/Symbolic_link symbolic link]'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo ln -s /Applications/Xtal/MacPyMOL.app/Contents/MacOS/MacPyMOL /usr/local/bin/pymol&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
or '''use this shell script''' [[User:Wgscott|I]] wrote: [http://xanana.ucsc.edu/Library/init/zsh/local-functions/xtal/pymol pymol] shell script (and zsh function) to invoke pymol on the command line. It uses OS X 10.4's mdfind to locate the executable.&lt;br /&gt;
&lt;br /&gt;
===IDLE===&lt;br /&gt;
MacPyMOL can also be run from within [http://www.python.org/idle/doc/idle2.html IDLE].  Make sure you use Fink's IDLE, not Mac IDLE:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
which idle2.5     # should return the following&lt;br /&gt;
/sw/bin/idle2.5   # Fink's IDLE.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Reading the pymolrc file===&lt;br /&gt;
In each case, PyMol will read the contents of the user's ~/.pymolrc file and/or ~/.pymolrc.py file (as with Linux).  Here is one example of a [[MacOSX-specific .pymolrc file]] with a script enabling interaction via the [[MAC_Install#PowerMate_Dial |PowerMate Dial]].  A couple of simple lines to put in your .pymolrc might be to respectively change to your favorite directory and increase the window size:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~/Documents/structures/&lt;br /&gt;
viewport 750,750&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Launching PyMOL from an external application==&lt;br /&gt;
If '''PYMOL_PATH''', '''LD_LIBRARY_PATH''', and '''TCL_LIBRARY''' are correctly defined, then you can launch PyMOL from an external Python program as shown in ''examples/devel/start_pymol.py''.  '''nb.''': This approach is not recommended, since the PyMOL launching process is subject to change without warning. The recommended approach is to just use PyMOL as your python interpreter:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
pymol -r &amp;lt;script.py&amp;gt;&lt;br /&gt;
pymol -qcr &amp;lt;script.py&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Running PyMOL in batch mode==&lt;br /&gt;
To perform PyMOL commands from stdin (file, pipe) without opening an OpenGL window use the following [[Command_Line_Options]]:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
pymol -cq&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
==Suppressing PyMOL output==&lt;br /&gt;
To suppress most of PyMOL's normal chatter, just type on the PyMOL command line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
feedback disable,all,actions&lt;br /&gt;
feedback disable,all,results&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
or, from Python (API):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
cmd.feedback(&amp;quot;disable&amp;quot;,&amp;quot;all&amp;quot;,&amp;quot;actions&amp;quot;)&lt;br /&gt;
cmd.feedback(&amp;quot;disable&amp;quot;,&amp;quot;all&amp;quot;,&amp;quot;results&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
==Launching Python scripts==&lt;br /&gt;
Running a Python script from PyMOL, usually the command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
run script.py&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Is enough. Of course, the file script.py needs to be in the working directory.  For more detailed examples, see the commands to launch Python scripts when starting PyMOL. Asynchronous means, that a new Python thread is started:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
pymol example.py     # synchronous, in PyMOL module&lt;br /&gt;
pymol -r example.py  # synchronous in __main__ module&lt;br /&gt;
pymol -l example.py  # asychronous in a new module&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also launch python programs from within PyMOL with the commands:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
run example.py        # synchronous in pymol module&lt;br /&gt;
run example.py,main   # synchronous in __main__ module&lt;br /&gt;
&lt;br /&gt;
spawn example.py        # asychronous in a new module&lt;br /&gt;
spawn example.py,global # asychronous in the PyMOL module&lt;br /&gt;
spawn example.py,main   # asychronous in the __main__ module&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Overwriting Default Settings==&lt;br /&gt;
If you don't like the cartoon default color and want to change default settings for it, from green to slate, you add the command line to do this in '''$HOME/.pymolrc'''.&lt;br /&gt;
Here, 'set cartoon_color, slate'&lt;br /&gt;
&lt;br /&gt;
Windows users can do this with a pymolrc file.&lt;br /&gt;
&lt;br /&gt;
[[Category:Launching]]&lt;/div&gt;</summary>
		<author><name>Hongbo zhu</name></author>
	</entry>
</feed>