CCTBX
This page describes how to use the Computational Crystallography Toolbox (cctbx) with PyMOL.
cctbx and PyMOL need to be compiled with the same Python distribution, otherwise they won't be compatible.
Incentive PyMOL
Using cctbx with Incentive PyMOL 2.x should become easier once the cctbx project provides conda packages. See https://github.com/cctbx/cctbx_project/issues/9
Confirmed procedure to get this working on Linux with CCTBX build dev-1723, which is based on conda:
- Download cctbx from http://cci.lbl.gov/cctbx_build/
- Install cctbx:
./install --prefix=$HOME/local
- Install Miniconda
- Install pymol with conda into the cctbx environment:
$HOME/miniconda3/bin/conda install -p $HOME/local/cctbx-dev-1723/conda_base -c schrodinger -c conda-forge pymol
- Activate cctbx:
source $HOME/local/cctbx-dev-1723/cctbx_env.sh
- Run PyMOL with:
cctbx.python -m pymol
Open-Source PyMOL
Confirmed procedure to get this working on Linux: Compile PyMOL with cctbx.python
Current cctbx builds neither include PyQt, nor a working Tkinter module. These need to be compiled from source if needed.
- Download cctbx from http://cci.lbl.gov/cctbx_build/
- Install cctbx:
./install --prefix=$HOME/local
- Activate cctbx:
source $HOME/local/cctbx-dev-1658/cctbx_env.sh
- Compile PyMOL with:
cctbx.python setup.py --glut install
(see Linux Install for details) - Install Pmw from https://github.com/schrodinger/pmw-patched with:
cctbx.python setup.py install
- Install
_tkinter.so
:- Download Python-2.7 source from https://www.python.org/downloads/release/python-2715/
cd Python-2.7.15/Modules
- Download https://pymol.org/tmp/setup_tkinter_cctbx.py
cctbx.python setup_tkinter_cctbx.py install
- Run PyMOL with:
cctbx.python -m pymol
The following instructions are outdated and might not work anymore
Windows XP (Roger Dodd)
1. Download and install python (to the default location - C:\Python24)
1a. If you want to use the draw_symops.py or draw_symops_cctbx.py scripts you also need to install numarray after installing python
2. Download cctbx *without* python included and unpack into C:\cctbx_build and C:\cctbx_sources (i.e. execute the file in C:\)
3. Download pymol built against python 2.4 (but not including its own python) and install in the default location
(Newer versions of PyMOL linked against an external python are available from Delano Scientific on request for holders of a valid subscription.)
4. Create 2 files (use notepad or wordpad or any other text editor) and save in the C:\Program Files\Delano Scientific\PyMOL directory:
a) pymol.cmd
@cctbx.python -x "%~f0" %* & exit /b import cctbx import pymol
b) run.cmd
CALL C:\cctbx_build\setpaths_all.bat CALL "C:\Program Files\Delano Scientific\PyMOL\pymol.cmd"
5. It's important to have python in your path variable (which you can access by going to control panel|system|advanced|environment variables), just add C:\python24 to the end of the path variable, separated by a semi-colon.
Linux (Robert Campbell)
When you run the setpaths.sh script, it adds the cctbx_build/bin directory to the *front* of your $PATH. In that directory is a shell script called "python" that sets the environment necessary to import cctbx. So, to get cctbx to work, you have to call python without prefixing a directory path. If you were like me and had:
/usr/bin/python $PYMOL_PATH/modules/launch_pymol.py $*
in your pymol.com file, then it would not run that cctbx_build/bin/python script. So you need to either change the above line to:
python $PYMOL_PATH/modules/launch_pymol.py $*
(assuming you've already run the setpaths.sh script) or you need to copy the cctbx_build/bin/python contents (without the actual "python" command) into your pymol.com file or some other file that you source before pymol.com.
Within pymol, type the command:
print sys.path
and you should now see the cctbx directories show up.