How to install PyMOL on Windows

Introduction

PyMOL is a user-sponsored molecular visualization system on an open-source foundation, maintained and distributed by Schrödinger.1 There are official binaries available for students,2 and unofficial versions out there as well. But the educational-use-only PyMOL is not provided for the purposes of academic research or publication.

So, I will explain how to install the unofficial PyMOL software in this tutorial.

PyMOL was written in the programming language Python, normal operation of the program required the Python environment. It's recommended to using Anaconda to create an isolated Python environment for PyMOL, if you need to use other softwares required Python environment in the future.

Install Anaconda to Create Python Environment

  1. Download Anaconda and install it (see: https://docs.anaconda.com/anaconda/install/windows/).

Anaconda is a distribution of the Python and R programming languages for scientific computing that aims to simplify package management and deployment.

  1. To verify Anaconda was installed successful, Open Anaconda Powershell Prompt (Anaconda3) or Anaconda Prompt (Anaconda3) on Windows Start Menu, type conde in the command line window and press enter key, you will see some information as below.
1
2
3
4
5
(base) C:\Users\jiangshen>conde
usage: conda-script.py [-h] [-V] command ...

conda is a tool for managing and deploying applications, environments and packages.
...
  1. Enter conda create -n pymol python=3.8 to create an insolated Python environment for PyMOL.
1
(base) C:\Users\jiangshen>conda create -n pymol python=3.8  # create an isolated environment named pymol which Python version is 3.8
  1. Enter conda activate pymol to activate pymol environment.
1
(base) C:\Users\jiangshen>conda activate pymol  # activate and enter the environment

The command line window will become as below.

1
2
3
(pymol) C:\Users\jiangshen>
\
\_____________ you are in the isolated enviroment named pymol
  1. (optional) Enter conda deactivate to come back base environment if you need.
1
2
(pymol) C:\Users\jiangshen>conda deactivate
(base) C:\Users\jiangshen>

Install PyMOL in One Line of Command

There is an easy way to install PyMOL in one line of command on conda3:

  1. Just run conda install -c conda-forge pymol-open-source on pymol environment.
1
(pymol) C:\Users\jiangshen>conda install -c conda-forge pymol-open-source
  1. After installation finished, enter pymol on Anaconda Prompt to launch PyMOL.
1
(pymol) C:\Users\jiangshen>pymol

(Optional) Install PyMOL by Pre-compiled Files

Or you can install PyMOL by pre-compiled files4, 5:

  1. Enter conda install -c conda-forge numpy pmw to install supporting packages on pymol environment.
1
(pymol) C:\Users\jiangshen>conda install -c conda-forge numpy pmw  # install supporting packages on pymol environment.
  1. Enter python --version to check you Python version of pymol environment.
1
2
(pymol) C:\Users\jiangshen>python --version
Python 3.8.9
  1. Download pre-compiled Open-Source PyMOL from Christoph Gohlke of the Laboratory for Fluorescence Dynamics, University of California, Irvine.

    The following two files are required:

    PyMOL and PyMOL launcher

1
2
3
4
5
6
7
8
9
10
11
pymol‑2.5.0‑cp38‑cp38‑win_amd64.whl
\ \
\ \____________ for Python 3.8.x
\
\______________ PyMOL version

pymol_launcher‑2.5‑cp38‑cp38‑win_amd64.whl
\ \
\ \____________ for Python 3.8.x
\
\______________ PyMOL launcher version
  1. Move two files above into a new directory (e.g. C:), enter the following commands step by step on Anaconda Prompt* to install PyMOL.
1
2
3
(pymol) C:\Users\jiangshen>pip install "C:\Downloads\pymol‑2.5.0‑cp38‑cp38‑win_amd64.whl"  # install pymol-2.5.0

(pymol) C:\Users\jiangshen>pip install "C:\Downloads\pymol_launcher‑2.5‑cp38‑cp38‑win_amd64.whl" # install pymol_launcher
  1. After all, you will find PyMOL.exe file in below directory.
1
2
3
4
5
C:\Users\YOUR_USER_NAME\anaconda3\envs\pymol
\ \
\ \______ the isolated enviroment named pymol
\
\__________________________________ replace with your name

Click the file and right click, Send To Desktop. Double click the PyMOL icon on desktop to launch PyMOL.

Or enter pymol on Anaconda Prompt to launch PyMOL.

1
2
3
(pymol) C:\Users\jiangshen>pymol
\
\_____________ you are in the isolated enviroment named pymol
  1. (optional) If you prefer viewing PyMOL in a single-window interface, install PyQt5 with pip install pyqt5.
1
(pymol) C:\Users\jiangshen>pip install pyqt5  # install PyQT5

References

[1] https://pymol.org/2/

[2] https://pymol.org/edu/?q=educational/

[3] https://anaconda.org/conda-forge/pymol-open-source

[4] http://www.lfd.uci.edu/~gohlke/pythonlibs/

[5] https://omicx.cc/posts/2021-04-20-install-pymol-windows/