Prerequisites
Installing a terminal emulator
Installing PyMOL and its prerequisites requires some use of a command-line interface (CLI). Although you can use CMD or Powershell directly, the Windows Terminal app is the recommended choice. The installation is very simple. The hyperlink provided should open the Microsoft Store webpage. Still, you can install it from your desktop. First, click on the star menu (or use the Windows key on your keyboard) then type “Microsoft Store”. The shortcut to the store should be the first link on the list (see below).
Shortcut to the Microsoft Store is the first link on the search results
Search for “Windows Terminal” in the store, then click on “Install”. After installation, the Windows Terminal should open automatically. The default session is a PowerShell instance, which we will use later. Windows Terminal startup screen
Update your PowerShell using the command winget install Microsoft.PowerShell
. It should take some time. After completion, close the Windows Terminal.
Installing an Environment Manager for Python
PyMOL requires the installation of specific Python dependencies, so it’s important that you don’t use the default python but an isolated environment. To orchestrate different Python installations on Windows, we will use the Miniconda manager, a popular choice for many scientific applications. You can download miniconda using this link. Usually, the 64-bit version is the right one. Just download the proper installer then execute it. In the “Advanced Installation Options” check “Add Miniconda3 to my PATH environment variable”, and also “Clear the package cache upon completion”. Do not use miniconda as the default python environment. See below which checkboxes should be active.
Miniconda advanced installation settings
After installation, open the Windows Terminal again and run the command conda --version
to check if the conda command is available in the PATH and it’s working properly. If you receive an output containing the current conda version, then everything is running good. Finally, run the command conda init
. This should take care of the PowerShell settings for you. Restart your Windows Terminal for the changes to take effect.
Installing PyMOL
The PyMOL Wiki has a guide to install PyMOL on Windows. Here, I provide some adaptions to this tutorial to install PyMOL in a conda environment.
First, create a folder on your computer where the installation will be performed. I used a folder named pymol inside my Downloads directory. Open the installation folder using Windows Explorer, then use the mouse right button to click on an empty space in the folder and then select the option “Open in Terminal”.
Open the Windows Terminal at the installation directory
Step-by-step installation
Download and install Microsoft Visual Studio 2015, 2017, 2019, and 2022. Use the X64 version here.
Download pre-compiled Open-Source PyMOL from this link. For this tutorial, you will need pymol_launcher-2.5-cp310-cp310-win_amd64 and pymol-2.6.0a0-cp310-cp310-win_amd64. The CPython version is very important. From the cp310 in the filenames we see that Python version 3.10 will be needed.
Create the conda environment using the proper python version (the same version stated in the .whl files). Use the command below in the Windows Terminal to create the environment and install pip and MKL-compiled numpy at creation time.
conda create -n "pymol-env" python=3.10 pip numpy
- Activate the conda environment you just created.
conda activate pymol-env
- Install dependencies for PyMOL using pip.
pip install Pmw pyqt5
- Install PyMOL. Make sure that the name of the pymol_launcher whl file is correct.
python -m pip install --no-index --find-links=$(Get-Location) .\pymol_launcher-2.5-cp310-cp310-win_amd64.whl
The aftermatch
A shortcut for PyMOL should be created for you by conda on the start menu. If not, use where.exe pymol
in the PowerShell to find the executable path and create the shortcut yourself.
In my installation the shortcut for PyMOL was created automatically
Using this shortcut should open PyMOL GUI. PyMOL GUI