Instructions for Installing PyRosetta on Windows 10
Instructions for Installing PyRosetta on Windows 10 with Anniversary Update
Page created 10/2016 using Windows 10 Home, version 1607
This article is intended to guide a user through the process of updating Windows 10 with the Anniversary Update, enabling BASH, and installing PyRosetta. The process will require at least one reboot of the computer. If the Anniversary Update is not installed, plan for a longer window of time, in order to install the update. If it is already installed, skip to step 2.
Make sure Windows is up to date on your computer.
a. Open Settings. This can be done by clicking the gear symbol in the bottom left when you tap the Windows key or click the bottom left icon. Alternatively, you can type ‘Settings’ into the search.
b. Go to Update & Security
c. Select the Windows Update tab on the left sidebar
d. Select Check for updates
e. If the Anniversary Update has not been installed, there will be updates listed to install. Install them. This may require some time and several reboots.
Change to Developer mode
Windows must be in Developer mode to use BASH.
a. Again under Settings, go to Update & Security (see above)
b. Select the For developers tab on the left sidebar
c. Select Developer mode
a. Open the Control Panel. This can be done with a search, or by scrolling down the apps list to Windows System > Control Panel
b. Go to Programs
c. Go to Programs and Features
d. Go to Turn Windows features on or off, on the left sidebar
e. Check the box for Windows Subsystem for Linux. Note: This option is not available if the Anniversary Update has not been installed.
f. At this point, one needs to open the Windows store and install one of the Linux flavors. Go to https://aka.ms/wslstore, choose Ubuntu, install. Then open bash. Then it forces you to make a new user with a password. Implementing this change will require a reboot of your computer.
After the restart, BASH should be available. It can be accessed either with a search or by scrolling down the apps list to Bash on Ubuntu on Windows. There are several install options.
Option 1: Set up a BASH user account
This approach is safer, but will require the use of that password and ‘sudo’ for subsequent steps. It reduces the risk of a casual user accidentally messing things up.
Open a BASH window and create a username and password.
Option 2: Set up a root account
With this approach, you are always the super user, so ‘sudo’ and a password input will not be necessary when using BASH from this account.
Open a Windows terminal (not BASH). A terminal can be opened either with a search, or by scrolling down the apps list to Windows System > Command Prompt
In the terminal window, enter the following:
Installing and running PyRosetta
Installing BASH functions
The following functions will be needed to properly set up PyRosetta4
Open a BASH window (see above) and type the following commands. Note that the 'sudo' may be omitted if the second BASH installation option was chosen. Otherwise, the first 'sudo' command will prompt you to put in the password you created.
There are several options for this. In either case, you should make or choose a directory for PyRosetta.
Option 1: Installing by direct download
A. Go to the PyRosetta 4 downloads page.
B. Enter username and password
C. Download the appropriate Linux Release wheel, based on your Python version
D. Move the downloaded file to the desired directory.
E. In BASH, move to the PyRosetta directory
F. install PyRosetta
If above steps have worked without errors then you can try it with the following command, first start iPython shell:
And in iPython shell:
And if everything working as expected then you should see output similar to:
Congratulations, you now have working PyRosetta install!
Few more examples:
PDB file name: ACDEFGHI
FOLD_TREE EDGE 1 20 -1
Residue 4: GLU (GLU, E):
Properties: POLYMER PROTEIN CANONICAL_AA SC_ORBITALS POLAR CHARGED NEGATIVE_CHARGE METALBINDING ALPHA_AA L_AA
Main-chain atoms: N CA C
Backbone atoms: N CA C O H HA
Side-chain atoms: CB CG CD OE1 OE2 1HB 2HB 1HG 2HG
N : 9.53449, 5.35894, 5.86727e-16
CA : 10.1896, 6.66148, -2.44225e-17
C : 11.7058, 6.51548, 9.3584e-16
O : 12.2319, 5.40254, 2.76825e-07
CB : 9.74645, 7.48145, 1.21373
CG : 8.75059, 6.7733, 2.12125
CD : 8.39724, 5.39412, 1.63846
OE1: 8.91075, 4.9912, 0.622485
OE2: 7.61256, 4.74245, 2.28668
H : 10.1015, 4.5231, 1.53279e-15
HA : 9.89999, 7.19446, -0.906235
1HB : 10.6181, 7.74355, 1.81372
2HB : 9.28915, 8.41188, 0.876963
1HG : 9.17642, 6.69754, 3.12143
2HG : 7.84419, 7.37357, 2.1867
Note that when you are done with ipython, you can exit the session and return to where you left off in BASH by typing control + d and entering y.
Running the PyMol Mover
For instructions on installing PyMOL, see https://www.pymol.org/install
For tips using the PyMOL_Mover, see http://www.pyrosetta.org/pymol_mover-tutorial
Ideally, having PyMOL and PyRosetta installed, and running PyMOLPyRosettaServer.py in PyMOL should work properly. However, there are several issues that have been noted, and their solutions follow.
If PyMOLPyRosettaServer.py is not present in the PyRosetta 4 download, it can be copied and pasted from an older PyRosetta 3 installation.
Port listing issues
On some computers, the default port for the PyMOL_Mover, 65000, is used by other programs. (DropBox and NVidia stream service have been identified so far.) In this case, PyMOL will return something like the following when told to run PyMOLPyRosettaServer.py, and it will be necessary to change the port usage.
PyMOL <---> PyRosetta link started!
at 127.0.0.1 port 65000
Exception in thread Thread-5:
Traceback (most recent call last):
File "C:\Program Files\PyMOL\PyMOL\py27\lib\threading.py", line 810, in __bootstrap_inner
File "C:\Program Files\PyMOL\PyMOL\py27\lib\threading.py", line 763, in run
File "PyMOLPyRosettaServer.py", line 1141, in main
udp_serv = PR_UDPServer(ip, port)
File "PyMOLPyRosettaServer.py", line 247, in __init__
StartUpError: FAILED TO START PyRosetta-PyMOL server.
Do you already have another instance of it running?
a. To see what ports are in use, open the Resource Monitor. This can be done with a search, or by scrolling down the apps list to Windows Administrative Tools > Resource Monitor
b. Go to the Network tab and open the Listening Ports dropdown. The used ports will all be listed in the Port column.
c. Select a port number that is not in use. This can be any number between 1024 and 65536. In the above example, 65002 was used.
d. Open PyMOLPyRosettaServer.py in a text editor.
e. Find the line, usually 1186 near the end of the file, that says
Change the port from 65000 to the new port number
f. In the future, when running PyRosetta and initiating the PyMOL_Mover, instead of using the command
use the following
g. If desired, this change can be made to the following files in the PyRosetta 4 test folder to view the tests in PyMOL:
All tests except 'C001_Carbohydrates_Demo01' should pass.
Tips and suggestions
Copying and Pasting in BASH on Windows
You may have noted that control + shift + c and control + shift + v do not work in the Windows BASH as they do on Linux. The best solution we have found so far is to do the following:
Right click on the top of the BASH window and select Properties
In the dialog box, check Quick Edit Mode. You may also want to Enable Ctrl key shortcuts. Then press OK.
Now, copying and pasting is possible. To copy text from the BASH window, highlight it and right click. Pasting can be done similarly; if you have copied text from elsewhere, right clicking into the command line will past the text into the BASH terminal.
Alternatively, copying and pasting can be made by right clicking the BASH icon and going to Edit.