[PyMOL] Newbie attempting to python script: ImportError: No module named _cmd

2009-05-01 Thread Luke Goodsell
Hi,

I'm trying to set up my machine to be able to run python scripts using 
the PyMol API, but whenever I try to import the pymol module, I get the 
following output:

 Traceback (most recent call last):
   File /Users/lukegoodsell/Documents/Rotation 2/PDB/potentials.py, 
 line 9, in module
 import pymol
   File 
 /System/Library/Frameworks/Python.framework/Versions/2.5/lib/pymol/pymol/__init__.py,
  
 line 438, in module
 import _cmd
 ImportError: No module named _cmd
Does anyone have any idea why this is? A search of Google and this 
mailing list's archive didn't turn up anything useful.

My script contains only the following (as pulled from PyMol wiki, iirc):
 #!/usr/bin/env python
  
 # Tell PyMOL we don't want any GUI features.
 import __main__
 __main__.pymol_argv = [ 'pymol', '-Gi' ]
  
 # Importing the PyMOL module will create the window.
  
 import pymol
  
 # Call the function below before using any PyMOL modules.
  
 pymol.finish_launching()
  
 from pymol import cm
I get the same error when attempting 'import pymol' from the python shell.

I am running Mac OS X 10.5.6. I downloaded MacPyMol 1.1r1 from 
http://delsci.com/macpymol/ (the educational edition, as I am a student).
My PYMOL_PATH: /Applications/PyMOLX11Hybrid.app/pymol
My PYMOL_EXE: /Applications/PyMOLX11Hybrid.app/Contents/MacOS/MacPyMOL

My PYTHONPATH (split for easier reading):
/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python
/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/PyObjC
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-tk
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-darwin
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac/lib-scriptpackates
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5.zip
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/pymol

I copied the contents of /Applications/PyMOLX11Hybrid.app/pymol/modules 
to /System/Library/Frameworks/Python.framework/Versions/2.5/lib/pymol, 
as per my understanding of the top of __init__.py

I am new to Macs, Python and the PyMol API, so the probability of a 
simple oversight on my part is high.

I appreciate any help.



--
Register Now  Save for Velocity, the Web Performance  Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance  Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
___
PyMOL-users mailing list
PyMOL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pymol-users


Re: [PyMOL] Newbie attempting to python script: ImportError: No module named _cmd

2009-05-01 Thread Nathaniel Echols
On Fri, May 1, 2009 at 3:57 AM, Luke Goodsell luke.goods...@gmail.comwrote:

 I'm trying to set up my machine to be able to run python scripts using
 the PyMol API, but whenever I try to import the pymol module, I get the
 following output:
 . . .
  I am running Mac OS X 10.5.6. I downloaded MacPyMol 1.1r1 from
 http://delsci.com/macpymol/ (the educational edition, as I am a student).
 My PYMOL_PATH: /Applications/PyMOLX11Hybrid.app/pymol
 My PYMOL_EXE: /Applications/PyMOLX11Hybrid.app/Contents/MacOS/MacPyMOL
 . . .
  I copied the contents of /Applications/PyMOLX11Hybrid.app/pymol/modules
 to /System/Library/Frameworks/Python.framework/Versions/2.5/lib/pymol,
 as per my understanding of the top of __init__.py


It's not entirely clear to me what you're trying to do, but I'm pretty
certain it's guaranteed not to work.  You can't just take compiled objects
from inside app bundles and move them around - especially on Mac.  You
definitely shouldn't be installing PyMOL modules that way.  If you need them
available for importing by /usr/bin/python, download the open-source version
from SourceForge and install it using python distutils (i.e. python
setup.py build and so on).  I just tried this and it seems to work fine -
only takes about 10 minutes.

-Nat
--
Register Now  Save for Velocity, the Web Performance  Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance  Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf___
PyMOL-users mailing list
PyMOL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pymol-users