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.
|