Difference between revisions of "Windows Install"

From PyMOLWiki
Jump to navigation Jump to search
(→‎Pre-compiled PyMOL: Gohlke's website no longer contains msi/exe files, so updating the instructions for the wheel (.whl) files found there now.)
Line 6: Line 6:
  
 
# Install Python 2.7 for Windows (e.g., by going to http://www.python.org/downloads/). Use the standard options (which should mean that the installation directory is C:\Python27). It may be useful if C:\Python27 is listed in your system PATH variable.  
 
# Install Python 2.7 for Windows (e.g., by going to http://www.python.org/downloads/). Use the standard options (which should mean that the installation directory is C:\Python27). It may be useful if C:\Python27 is listed in your system PATH variable.  
# Download the [http://www.lfd.uci.edu/~gohlke/pythonlibs/#pymol appropriate wheel files], along with all requirement wheel files (including [http://www.lfd.uci.edu/~gohlke/pythonlibs/#pip pip], [http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy Numpy] and [http://www.lfd.uci.edu/~gohlke/pythonlibs/#pmw PMW]) into a single file directory, e.g., <code>C:\PyMOL_installation</code>
+
# Download the [http://www.lfd.uci.edu/~gohlke/pythonlibs/#pymol appropriate wheel files], along with all requirement wheel files (including [http://www.lfd.uci.edu/~gohlke/pythonlibs/#pip pip], [http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy Numpy] and [http://www.lfd.uci.edu/~gohlke/pythonlibs/#pmw PMW]) into a single file directory, e.g., <source>C:\PyMOL_installation</source>
# From this installation directory (to get there you can run <code>cd C:\PyMOL_installation</code> from the command prompt), run:
+
# From this installation directory (to get there you can run <source>cd C:\PyMOL_installation</source> from the command prompt), run:
<code>C:\Python27\python.exe pip-6.x.x-py2.py3-none-any.whl/pip install --no-index --find-links="%CD%" pymol_launcher</code>
+
<source>C:\Python27\python.exe pip-6.x.x-py2.py3-none-any.whl/pip install --no-index --find-links="%CD%" pymol_launcher</source>
  
 
if <code>C:\Python27</code> is part of your PATH variable, then running (where x refers to the version number of pip):
 
if <code>C:\Python27</code> is part of your PATH variable, then running (where x refers to the version number of pip):
<code>python pip-6.x.x-py2.py3-none-any.whl/pip install --no-index --find-links="%CD%" pymol_launcher</code>
+
<source>python pip-6.x.x-py2.py3-none-any.whl/pip install --no-index --find-links="%CD%" pymol_launcher</source>
 
should suffice. To update PyMOL update the files in the PyMOL install directory and run:
 
should suffice. To update PyMOL update the files in the PyMOL install directory and run:
  
<code>pip install --upgrade --no-deps pymol.whl</code>
+
<source>pip install --upgrade --no-deps pymol.whl</source>
  
 
where <code>pymol.whl</code> is replaced by the PyMOL wheel file name (not the launcher, the launcher should not require updating).  
 
where <code>pymol.whl</code> is replaced by the PyMOL wheel file name (not the launcher, the launcher should not require updating).  

Revision as of 05:52, 6 May 2015


Installing

Pre-compiled PyMOL

Pre-compiled PyMOL is available free from Christoph Gohlke of the Laboratory for Fluorescence Dynamics, University of California, Irvine here.

  1. Install Python 2.7 for Windows (e.g., by going to http://www.python.org/downloads/). Use the standard options (which should mean that the installation directory is C:\Python27). It may be useful if C:\Python27 is listed in your system PATH variable.
  2. Download the appropriate wheel files, along with all requirement wheel files (including pip, Numpy and PMW) into a single file directory, e.g.,
    C:\PyMOL_installation
  3. From this installation directory (to get there you can run
    cd C:\PyMOL_installation
    from the command prompt), run:
C:\Python27\python.exe pip-6.x.x-py2.py3-none-any.whl/pip install --no-index --find-links="%CD%" pymol_launcher

if C:\Python27 is part of your PATH variable, then running (where x refers to the version number of pip):

python pip-6.x.x-py2.py3-none-any.whl/pip install --no-index --find-links="%CD%" pymol_launcher

should suffice. To update PyMOL update the files in the PyMOL install directory and run:

pip install --upgrade --no-deps pymol.whl

where pymol.whl is replaced by the PyMOL wheel file name (not the launcher, the launcher should not require updating).

Extend PyMOL with additional scripts

If you now want to extend the capabilities of PyMOL, and take advantage of all the available plugins+scripts "out there", then do the following.

  1. First install "numpy" as an available module to Python. Select appropriate installer from here
  2. Download the script/plugin collection Pymol-script-repo from a .zip file from here
git clone https://github.com/Pymol-Scripts/Pymol-script-repo
  1. Unpack it to here: C:\Python27\Lib\site-packages\pymol\pymol_path\Pymol-script-repo Double check that the folder name is correct and the same.

Open "Notepad" and write.

# Add paths to sys.path so PyMOL can find modules and scripts
import sys, os
pymol_git = os.path.abspath(os.path.join(os.environ['PYMOL_PATH'], 'Pymol-script-repo'))
os.environ['PYMOL_GIT_MOD'] = os.path.join(pymol_git,'modules')
sys.path.append(pymol_git)
sys.path.append(os.environ['PYMOL_GIT_MOD'])

# Make setting changes to Plugin Manager
import pymol.plugins
pymol.plugins.preferences = {'instantsave': False, 'verbose': False}
pymol.plugins.autoload = {'apbs_tools': False}
pymol.plugins.set_startup_path([os.path.join(pymol_git, 'plugins'), os.path.join(sys.prefix, 'Lib', 'site-packages', 'pmg_tk', 'startup')])
pymol.plugins.preferences = {'instantsave': True, 'verbose': False}

Then "File->Save as->All files-> C:\Python27\Lib\site-packages\pymol\pymol_path\run_on_startup.py

Now start pymol, and enjoy all the plugins available from the menu.

PyMoL shortcut
Make a pymol directory in your homepath. mkdir %HOMEPATH%\pymol Then make sure, PyMOL starts here, when you open the shortcut.
Make a shotcut to the .cmd file, and modify it.
Target: C:\python27\PyMOL\pymol.cmd
Start in: %HOMEPATH%\pymol

Personal changes to opening of PyMOL

You can make a "pymolrc.pym" file, and put it under "C:\Users\YOU".
In the file you can write things that PyMOL should change from standard values, when it opens.
See more here.

Binary

To install PyMOL from the binaries, just run the executable you've downloaded.

Source

To get the latest features, you should download the PyMOL source from the project page.

Directions using CygWin

  • Install CygWin. Make sure you install the following modules:

You should have similar packages installed as described here. Note, that you might need gcc-4.4 instead of gcc-4.5.

    • C++ (gcc or g++ package name)
    • Python
    • OpenGL
    • PNG
  • run python setup.py install in the source directory
  • run python setup2.py install in the source directory
  • install Pmw