Windows Install: Difference between revisions

From PyMOLWiki
Jump to navigation Jump to search
(fix broken links)
 
(42 intermediate revisions by 6 users not shown)
Line 1: Line 1:
[[Category:Installation|Windows]]
This page describes how to install PyMOL on Microsoft Windows.


== Installing ==
== Incentive PyMOL ==
=== Binary ===
To install PyMOL from the binaries, just run the executable you've [http://pymol.sf.net/ downloaded].


=== Source ===
[http://www.schrodinger.com Schrödinger] provides an installer to paying sponsors (EXE for PyMOL 2.0, MSI for previous version). The bundle also includes ready-to-use [[APBS]], [[morph|RigiMOL]], an MPEG encoder for movie export, and a small molecule energy minimization engine.
To get the latest features, you should download the [http://sourceforge.net/svn/?group_id=4546 PyMOL source] from the [http://sourceforge.net/projects/pymol/ project page].


==== Directions using CygWin ====
Download: https://pymol.org/#download
* Install [http://www.cygwin.com/ CygWin].  Make sure you install the following modules:
You should have similar packages installed as described [http://www.pymolwiki.org/index.php/Linux_Install#Mint11_Linux_.28Ubuntu.29_-_Tested_for_PyMOL_1.4.1 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


== Pre-compiled PyMOL ==
== Open-Source PyMOL ==
Pre-compiled PyMOL is also available free from Christoph Gohlke of the Laboratory for Fluorescence Dynamics, University of California, Irvine [http://www.lfd.uci.edu/~gohlke/pythonlibs/#pymol here].


For example install [http://www.python.org/getit/releases/2.7/ python 2.7] on windows, and then compile the open source pymol 1.4.1 for free.
Open-Source PyMOL is available [https://github.com/schrodinger/pymol-open-source/blob/master/LICENSE free of charge]. It also allows sponsors to create highly customized PyMOL installations which might not be possible with the MSI installer.
# Install python, (2.5, or 2.6) 2.7 for windows.
# Download [ http://www.lfd.uci.edu/~gohlke/pythonlibs/#pymol appropriate installer] and select according to your python version and system.
# Run the downloaded installer
# PyMOL is now installed in: C:\Python27\PyMOL
<br/>
# Edit '''C:\Python2X\PyMOL\PDB_file.reg ''' so it matches your python version. That makes sure that .pdb files has the right icon and is opened with pymol.
<source lang="bash">
REGEDIT4


[-HKEY_CLASSES_ROOT\.pdb]
Pre-compiled Open-Source PyMOL is available free from [https://www.cgohlke.com/ Christoph Gohlke of the Laboratory for Fluorescence Dynamics, University of California, Irvine].
[HKEY_CLASSES_ROOT\.pdb]
@="PDB.File"
"Content Type"="chemical/x-pdb"
[-HKEY_CLASSES_ROOT\PDB.File]
[HKEY_CLASSES_ROOT\PDB.File]
@="PDB File"
[HKEY_CLASSES_ROOT\PDB.File\DefaultIcon]
@="C:\\Python27\\PyMOL\\PyMOL.exe"
[HKEY_CLASSES_ROOT\PDB.File\Shell]
@=""
[HKEY_CLASSES_ROOT\PDB.File\Shell\open]
[HKEY_CLASSES_ROOT\PDB.File\Shell\open\command]
@="\"C:\\Python27\\PyMOL\\PyMOL.cmd\" %*"


[-HKEY_CLASSES_ROOT\.pml]
# Install the latest version of Python 3 for Windows (e.g., by going to http://www.python.org/downloads/ and choosing the x64 EXE installer). Use the standard options, which should mean that the installation directory is most likely C:\Users\<Your Username>\AppData\Local\Programs\Python\Python38). Make sure the option to add environment variables is selected or add the folder of python.exe to system PATH.
[HKEY_CLASSES_ROOT\.pml]
# Install [https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads the current Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019]. Otherwise the installed PyMOL binary may fail to run (without any error message!).
@="PML.File"
## Have a look in "Add/Remove" programs if it's installed already
"Content Type"="script/x-pymol"
# Download the [https://github.com/cgohlke/pymol-open-source-wheels/ appropriate wheel files], along with all requirement wheel files ([https://github.com/cgohlke/numpy-mkl-wheels/ Numpy+MKL]) into a single file directory, e.g., <code>C:\Users\<Your Username>\Downloads</code>
[-HKEY_CLASSES_ROOT\PML.File]
# Example of filenames 2023-01-12
[HKEY_CLASSES_ROOT\PML.File]
## pymol_launcher-2.5-cp311-cp311-win_amd64.whl
@="PML File"
## pymol-2.6.0a0-cp311-cp311-win_amd64.whl
[HKEY_CLASSES_ROOT\PML.File\DefaultIcon]
## numpy-1.22.4+mkl-cp311-cp311-win_amd64.whl
@="C:\\Python27\\PyMOL\\PyMOL.exe"
[HKEY_CLASSES_ROOT\PML.File\Shell]
@=""
[HKEY_CLASSES_ROOT\PML.File\Shell\open]
[HKEY_CLASSES_ROOT\PML.File\Shell\open\command]
@="\"C:\\Python27\\PyMOL\\PyMOL.cmd\" %*"
</source>
Run it with regedit and restart so changes take effect. After restart, you should see the PyMOL icon for .pdb files and be able to double click it to launch PyMOL.
Pymol can also started by clicking C:\Python27\PyMOL\pymol.cmd  which executes python on C:\Python27\PyMOL\pymol-launch.py. Make a link to pymol.cmd.


You can make a "pymolrc.pym" file, and put it under "C:\Users\YOU". In the file you can write the following listed. This folder is now in your PyMOL search path, so you can put pymol wiki scripts here. Note the forward slashes "/".
Navigate to the installation directory in a CMD window (Not PowerShell!) <source lang = python>cd C:\Users\<Your Username>\Downloads</source> (or where ever you put the files) and begin the installation using the command: ("%CD%" only works in CMD)
<source lang="python">
<source lang = python>
import sys
python -m pip pmw
sys.path.append("C:/Python27/PyMOL/scripts")
python -m pip install --no-index --find-links="%CD%" pymol_launcher-2.5-cp311-cp311-win_amd64.whl
where.exe pymol
pymol
</source>
</source>


== Problems &amp; Solutions ==
PyMOL.exe should now be in C:\Users\<Your Username>\AppData\Local\Programs\Python


===Problem: Installing PyMol 0.98 on WinXP Pro SP2===
To use the newer single-window Qt interface, also install the optional PyQt5 dependency for your Python installation:  
If you get the following error '''while''' installing
<source lang=python>
<pre>
python -m pip install pyqt5
"16-bit Windows Subsystem.":
</source>
"C:\WINDOWS\SYSTEM32\AUTOEXEC.NT. The system file is not
suitable for running MS-DOS and Microsoft Windows applications.
Choose 'Close' to terminate the application.
</pre>
'''Fix''': Sounds like the '''AUTOEXEC.NT''' file is corrupt.  You can fix this problem by replacing
c:\WINDOWS\SYSTEM32\AUTOEXEC.NT
with the one in
c:\windows\repair
However if this doesn't work (or if the file is absent from this repair folder), use the file on the installation CDROM, it is
autoexec.nt_
in the '''i386''' folder.  Just type in a command window:
expand X:\i386\autoexec.nt_ c:\windows\system32\autoexec.nt
where '''X''' is the drive letter of your CDROM.


If this does not resolve your issue, visit this link:
To update PyMOL update the files in the PyMOL install directory and run:  
[http://support.microsoft.com/default.aspx?scid=kb;en-us;324767 MS Support For This Issue]
<source lang = python>
where you may also find the answer to your question.
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).  




=== 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. <br>
# First install "numpy" as an available module to Python. [https://github.com/cgohlke/numpy-mkl-wheels/ Select appropriate installer from here]
# Download the script/plugin collection [[Git | Pymol-script-repo]] from [https://github.com/Pymol-Scripts/Pymol-script-repo/zipball/master a .zip file from here]
git clone https://github.com/Pymol-Scripts/Pymol-script-repo
# 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.
<syntaxhighlight lang="python">
# 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'])


===Problem: PyMol Binary Crashes===
# Make setting changes to Plugin Manager
==== Video Driver ====
import pymol.plugins
'''Fix''': Try updating your video card's driver software.  This is a common problem on laptops.
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}
</syntaxhighlight>
'''Then "File->Save as->All files-> C:\Python27\Lib\site-packages\pymol\pymol_path\run_on_startup.py'''


==== msvcr71.dll ====
Now start pymol, and enjoy all the plugins available from the menu.
'''Fix''': find the file '''msvcr71.dll''' on your computer and copy it to the directory that PyMol was installed to.


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


== See Also ==


===Problem: Path Does Not Exist Error ===
* [[pymolrc]]
 
* [[Linux Install]]
'''Install Shield Problem with some Dell Laptops'''
* [[MAC Install]]
 
With this problem irrespective of where you place the binaries for installing PyMol you receive an error claiming that the path\setup.exe does not exist.
 
'''Fix''': Install the windows binary through 16-bit MS-DOS console.
 
First place the PyMol setup binaries in an easy to find folder, e.g. C:\PyMol
 
Use the '''RUN''' command via '''Windows Start'''.
 
In the '''CLI''' type '''COMMAND.COM''' (note CMD will not work as it is a native interface and not true DOS).
 
In the '''DOS CLI''' that opens go back to the root directory '''C:\''' using the '''cd..''' command.
 
Then go to the folder into which you placed PyMol, e.g. '''cd PyMol'''.
 
Then type in '''setup.exe'''.
 
PyMol should now install, simply type '''exit''' to close the '''DOS CLI'''
 
== Using ==
===Debugging===
On Windows, you need to launch PyMOLWin.exe from a Windows command line with the "+2" option to prevent PyMOL from hiding the console window:
(start menu -> run -> cmd [return])
 
<source lang="bash">
cd c:\program files\delano scientific\pymol
 
pymolwin + 2
</source>


[[Category:Installation|Windows]]
[[Category:Technical Issues|Windows Install]]
[[Category:Technical Issues|Windows Install]]
[[Category:Windows]]
[[Category:Windows]]

Latest revision as of 09:15, 28 July 2024

This page describes how to install PyMOL on Microsoft Windows.

Incentive PyMOL

Schrödinger provides an installer to paying sponsors (EXE for PyMOL 2.0, MSI for previous version). 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/#download

Open-Source PyMOL

Open-Source PyMOL is available free of charge. It also allows sponsors to create highly customized PyMOL installations which might not be possible with the MSI installer.

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

  1. Install the latest version of Python 3 for Windows (e.g., by going to http://www.python.org/downloads/ and choosing the x64 EXE installer). Use the standard options, which should mean that the installation directory is most likely C:\Users\<Your Username>\AppData\Local\Programs\Python\Python38). Make sure the option to add environment variables is selected or add the folder of python.exe to system PATH.
  2. Install the current Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019. Otherwise the installed PyMOL binary may fail to run (without any error message!).
    1. Have a look in "Add/Remove" programs if it's installed already
  3. Download the appropriate wheel files, along with all requirement wheel files (Numpy+MKL) into a single file directory, e.g., C:\Users\<Your Username>\Downloads
  4. Example of filenames 2023-01-12
    1. pymol_launcher-2.5-cp311-cp311-win_amd64.whl
    2. pymol-2.6.0a0-cp311-cp311-win_amd64.whl
    3. numpy-1.22.4+mkl-cp311-cp311-win_amd64.whl

Navigate to the installation directory in a CMD window (Not PowerShell!)

cd C:\Users\<Your Username>\Downloads

(or where ever you put the files) and begin the installation using the command: ("%CD%" only works in CMD)

python -m pip pmw
python -m pip install --no-index --find-links="%CD%" pymol_launcher-2.5-cp311-cp311-win_amd64.whl
where.exe pymol
pymol

PyMOL.exe should now be in C:\Users\<Your Username>\AppData\Local\Programs\Python

To use the newer single-window Qt interface, also install the optional PyQt5 dependency for your Python installation:

python -m pip install pyqt5

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 shortcut to the .cmd file, and modify it.
Target: C:\python27\PyMOL\pymol.cmd
Start in: %HOMEPATH%\pymol

See Also