From: Yi Z. <yz...@xr...> - 2005-08-18 19:20:00
|
Dear all, I am trying some of pymol scripts from Prof. Robert L. Campbell, which require cctbx module. but I don't know how to put pymol and cctbx togther. I download window version of cctbx/python2.4 bundle. and I download pymol-0_98rc5-bin-win32-py24.zip. Installation of cctbx is fine, but I got an error message that pymol can't locate python when I tried to install pymol into site-packages directory. I don't know how to solve this problem since I am new to python scripting. Could anyone give me a hand? Thanks! Sincerely, Yi Zhang |
From: Roger D. <rb...@ca...> - 2005-08-23 09:02:06
Attachments:
rbd22.vcf
|
Hi all, I hesitated to post this because I thought someone would have a more elegant solution, but I have got the draw_cell/symmops scripts working on windows with cctbx. I have had it working with all versions of PyMOL including the latest betas. I install PyMOL as usual in C:\Program Files\Delano Scientific\PyMOL. I also got hold of python 2.4.1 (http://www.python.org/ftp/python/2.4.1/python-2.4.1.msi) and cctbx (http://cci.lbl.gov/cctbx_build/results/2005_08_18_0201/cctbx_win_xp_py24_pre.exe) and installed them to C:\python24 and C:\cctbx_build & C:\cctbx_sources, respectively. In order to get things working together, I launch PyMOL with the following batch file: @ECHO off set LIBTBX_DIST_ROOT=C:\cctbx_sources if not defined PYTHONPATH set PYTHONPATH= set PYTHONPATH=C:\cctbx_sources\boost_adaptbx;C:\cctbx_sources\scitbx;C:\cctbx_sources\cctbx;C:\cctbx_sources\iotbx;C:\cctbx_build\libtbx;C:\cctbx_sources\libtbx;%PYTHONPATH% set LIBTBX_BUILD=C:\cctbx_build set LIBTBX_PYTHON_EXE=C:\Python24\python.exe if not defined PATH set PATH= set PATH=C:\cctbx_build\libtbx\bin;C:\cctbx_build\libtbx;%PATH% set SCITBX_DIST=C:\cctbx_sources\scitbx set IOTBX_DIST=C:\cctbx_sources\iotbx set CCTBX_DIST=C:\cctbx_sources\cctbx set BOOST_ADAPTBX_DIST=C:\cctbx_sources\boost_adaptbx set LIBTBX_DIST=C:\cctbx_sources\libtbx if not defined PATHEXT set PATHEXT= set PATHEXT=.PX;.PY;%PATHEXT% call "%LIBTBX_PYTHON_EXE%" "%LIBTBX_DIST%\libtbx\assoc_ftype.py" "C:\Program Files\DeLano Scientific\PyMOL\PyMOLWin.exe" +2 .... just save as PyMOL.bat and run it (this is basically the cctbx setpaths.bat with a pymol command tagged on the end). I hope this helps. Cheers Roger |
From: Sabuj P. <sab...@va...> - 2005-08-18 21:08:54
|
Actually I was wondering the same thing, except how to set it up in linux. I was able to compile the cctbx but I'm not sure how to get it to show up as a python module so that Pymol scripts (e.g. Dr. Campbell's draw_cell.py) can work. Any help would be greatly appreciated. Yi Zhang wrote: > Dear all, > > I am trying some of pymol scripts from Prof. Robert L. Campbell, which > require cctbx module. but I don't know how to put pymol and cctbx > togther. > > Sincerely, > > Yi Zhang |
From: Robert C. <rl...@po...> - 2005-08-22 20:07:35
|
Hi, * Sabuj Pattanayek <sab...@va...> [2005-08-18 16:08] wrote: > Actually I was wondering the same thing, except how to set it up in > linux. I was able to compile the cctbx but I'm not sure how to get it to > show up as a python module so that Pymol scripts (e.g. Dr. Campbell's > draw_cell.py) can work. Any help would be greatly appreciated. > > Yi Zhang wrote: > >Dear all, > > > >I am trying some of pymol scripts from Prof. Robert L. Campbell, which > >require cctbx module. but I don't know how to put pymol and cctbx > >togther. I suggested that Yi Zhang ask this on the list, since I have no experience with trying to make this work under Windows. Under Linux, though, I can say that you need to build both cctbx and PyMOL from source to make sure that they are using the same python executable and therefore they can "see" all the available modules for importing and to ensure that all modules are byte-compiled with the same version of Python. Otherwise, even if the modules are visible, you may get version conflict errors when trying to import a module. I use PyMOL built from the CVS source (I like to have the latest and greatest features!). Once this is done the first time, it is a simple process to rebuild it when the CVS entries are updated. The cctbx is easily built from source. Follow the "Downloads" link on http://cctbx.sourceforge.net and look for either the "Self-extracting binary distributions" and use the "cctbx only" version or install the "Self-extracting cctbx sources for Unix". I use the latter just to make sure that it is compiled for the system libraries I have available on my computers. The installation is done with: perl cctbx_bundle.selfx and this will create a setup file that needs to be run: source cctbx_build/setpaths.sh (or .csh if you use a csh variant). The installation is exactly the same with the "self-extracting binary distributions" (apart from the file name used in the "perl" command). I hope this is sufficiently clear. I guess I should create a page of these instructions and link to it from my PyMOL scripts page. Cheers, Rob -- Robert L. Campbell, Ph.D. <rl...@po...> Senior Research Associate phone: 613-533-6821 Dept. of Biochemistry, Queen's University, fax: 613-533-2497 Kingston, ON K7L 3N6 Canada http://adelie.biochem.queensu.ca/~rlc PGP Fingerprint: 9B49 3D3F A489 05DC B35C 8E33 F238 A8F5 F635 C0E2 |
From: Sabuj P. <sab...@va...> - 2005-08-22 23:03:35
|
Hi, Thank you for replying. In fact this is what I did. Gentoo automatically compiles pymol (pymol ebuild) with all required dependencies against the system-wide python-2.4.1. I then manually installed cctbx, did "source /usr/lib64/python-2.4/site-packages/setpaths_all.csh" and "source /usr/lib64/python-2.4/site-packages/setpaths.csh", ran pymol, opened up a pdb with CRYST header and tried to run the draw_cell.py script and I got this error: PyMOL>run draw_cell.py Traceback (most recent call last): File "/usr/lib64/python2.4/site-packages/pymol/parser.py", line 270, in parse execfile(exp_path(args[nest][0]),pymol_names,pymol_names) File "draw_cell.py", line 3, in ? from cctbx import uctbx, sgtbx ImportError: No module named cctbx When I ran the command "python $SCITBX_DIST/run_tests.py" all the tests completed with OK status. I tried adding: from libtbx import uctbx, sgtbx import libtbx.load_env as it has in the run_tests.py file but it gave the same error (No module named libtbx). What else needs to be done so that the python scripts can see the module when loaded through pymol? Could it possibly be that when pymol is executed it loads a new environment and thus the cctbx paths are not set in this new environment? Thanks, Sabuj Pattanayek Robert Campbell wrote: > Hi, > > * Sabuj Pattanayek <sab...@va...> [2005-08-18 16:08] wrote: > >>Actually I was wondering the same thing, except how to set it up in >>linux. I was able to compile the cctbx but I'm not sure how to get it to >>show up as a python module so that Pymol scripts (e.g. Dr. Campbell's >>draw_cell.py) can work. Any help would be greatly appreciated. > > I use PyMOL built from the CVS source (I like to have the latest and > greatest features!). Once this is done the first time, it is a simple > process to rebuild it when the CVS entries are updated. > > The cctbx is easily built from source. Follow the "Downloads" link on > http://cctbx.sourceforge.net and look for either the "Self-extracting > binary distributions" and use the "cctbx only" version or install the > "Self-extracting cctbx sources for Unix". I use the latter just to make > sure that it is compiled for the system libraries I have available on my > computers. The installation is done with: > > perl cctbx_bundle.selfx > > and this will create a setup file that needs to be run: > > source cctbx_build/setpaths.sh (or .csh if you use a csh variant). > > The installation is exactly the same with the "self-extracting binary > distributions" (apart from the file name used in the "perl" command). > > I hope this is sufficiently clear. I guess I should create a page of > these instructions and link to it from my PyMOL scripts page. > > Cheers, > Rob |
From: Robert C. <rl...@po...> - 2005-08-23 13:02:01
|
Hi Sabuj, * Sabuj Pattanayek <sab...@va...> [2005-08-22 18:03] wrote: > Hi, > > Thank you for replying. > > In fact this is what I did. Gentoo automatically compiles pymol (pymol > ebuild) with all required dependencies against the system-wide > python-2.4.1. I then manually installed cctbx, did "source > /usr/lib64/python-2.4/site-packages/setpaths_all.csh" and "source > /usr/lib64/python-2.4/site-packages/setpaths.csh", ran pymol, opened up > a pdb with CRYST header and tried to run the draw_cell.py script and I > got this error: > > PyMOL>run draw_cell.py > Traceback (most recent call last): > File "/usr/lib64/python2.4/site-packages/pymol/parser.py", line 270, > in parse > execfile(exp_path(args[nest][0]),pymol_names,pymol_names) > File "draw_cell.py", line 3, in ? > from cctbx import uctbx, sgtbx > ImportError: No module named cctbx > I just tested it and of course it failed for me, too! It must be that there was a slight change in the cctbx since my previous compilation of it. Or else I had modified something to take it into account and have since forgotten. 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. I hope this is clear enough! Cheers, Rob -- Robert L. Campbell, Ph.D. <rl...@po...> Senior Research Associate phone: 613-533-6821 Dept. of Biochemistry, Queen's University, fax: 613-533-2497 Kingston, ON K7L 3N6 Canada http://adelie.biochem.queensu.ca/~rlc PGP Fingerprint: 9B49 3D3F A489 05DC B35C 8E33 F238 A8F5 F635 C0E2 |
From: Sabuj P. <sab...@va...> - 2005-08-23 17:18:10
|
Hi, This worked. Thanks, ..Sabuj Robert Campbell wrote: > 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 $* |
From: Jianghai Z. <zh...@pu...> - 2005-08-24 05:59:51
|
Hi, I could not get cctbx work under either MacPymol or PymolX11Hybrid in Mac OS X. Anywhere I can find some instructions to get cctbx work in OS X? Thanks. Jianghai On Aug 23, 2005, at 1:18 PM, Sabuj Pattanayek wrote: > Hi, > > This worked. > > Thanks, > ..Sabuj > > Robert Campbell wrote: >> 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 $* > |
From: Robert C. <rl...@po...> - 2005-08-24 13:35:57
|
Hi, * Jianghai Zhu <zh...@pu...> [2005-08-24 01:59] wrote: > > I could not get cctbx work under either MacPymol or PymolX11Hybrid in > Mac OS X. Anywhere I can find some instructions to get cctbx work in > OS X? There is a page on the cctbx with special instructions for using it on the Mac: http://cci.lbl.gov/cctbx_build/mac_os_x_notes.html Note that you need to use the "Framework" build of PyMOL: http://delsci.com/frameworkpymol/ Unfortunately there isn't a Mac around here for me to test this stuff on. Cheers, Rob -- Robert L. Campbell, Ph.D. <rl...@po...> Senior Research Associate phone: 613-533-6821 Dept. of Biochemistry, Queen's University, fax: 613-533-2497 Kingston, ON K7L 3N6 Canada http://adelie.biochem.queensu.ca/~rlc PGP Fingerprint: 9B49 3D3F A489 05DC B35C 8E33 F238 A8F5 F635 C0E2 |
From: Peter A. M. <pa...@co...> - 2005-08-19 13:19:47
|
> I am trying some of pymol scripts from Prof. Robert L. Campbell, which require cctbx module. but I don't know how to put pymol and cctbx togther. > I download window version of cctbx/python2.4 bundle. and I download pymol-0_98rc5-bin-win32-py24.zip. Installation of cctbx is fine, but I got > an error message that pymol can't locate python when I tried to install pymol into site-packages directory. I don't know how to solve this problem > since I am new to python scripting. Could anyone give me a hand? Thanks! There could be a couple of things. The first thing to check is that the python path (called PYTHONHOME on unix; not sure about windows) is set up correctly (the executable path may need adjusting as well, maybe try running with the full path). A workaround for python path that should work on windows is to add few lines to the beginning of a python script: import sys (may not be needed if sys module has already been imported), followed by sys.path.append("full path to the python/cctbx/pymol modules you want to install). For python on windows, any compiled modules (which includes parts of cctbx and pymol) have to be compiled with the same compiler (VisualC++,gcc, etc), and possible same version, as the python interpreter was complied with. I'm not sure how you'd go about resolving this, other than hoping the compiler versions happened to match, or trying to compile both with the same compiler. The third possible problem could be that both cctbx and pymol can come packaged with their own python interpreters (I'm not sure how the windows executable versions are packaged), so you'll need to make sure that both are using the same interpreter. For unix/linux(/os x?), this the fix would be to install everything from source, and use environmental variables to make sure that pymol knows about the cctbx packages, and cctbx knows which python to install itself to. For windows it's likely to be more difficult, if it was me I'd install cygwin (unix emulator for windows), and just install everything there. Hope some of this is helpful, Pete Pete Meyer Fu Lab BMCB grad student Cornell University |