Hi David, incentive pymol builds have the python interpreter and the _cmd module built into the pymol.exe executable. This means running the script with your system python is not supported. Instead, run your script with pymol, without the GUI, like this:
/opt/soft/pymol-v1.5.0.3/pymol -cqr script.py Hope that helps. Cheers, Thomas On 05 Dec 2013, at 06:26, David McGiven wrote: > Dear PyMOL Users, > > I am trying to run some pymol functions from a python script. For simplicity > purposes, the script is called "script.py" and it's as simple as this : > > #cat script.py > import pymol > # > > Then I run it like this : > > #export PYMOL_PATH=/opt/soft/pymol-v1.5.0.3 > #export PYTHONPATH=/opt/soft/pymol-v1.5.0.3/modules > #python script.py > Traceback (most recent call last): > File "py.py", line 1, in <module> > import pymol > File "/opt/soft/pymol-v1.5.0.3/modules/pymol/__init__.py", line 473, in > <module> > import _cmd > ImportError: No module named _cmd > > I don't understand why is it giving this error. I am running CentOS 6.2. I > have edited $PYMOL_PATH/modules/pymol/__init.py__ and checked the > instructions on the top of the file. It says : > # THE SUPPORTED WAY: > > # "python pymol/__init__.py" in an environment in which $PYMOL_PATH > # points to the main PyMOL directory and $PYTHONPATH includes > # $PYMOL_PATH/modules or where the contents of $PYMOL_PATH/modules > # have been installed in a standard location such as > # /usr/lib/python2.1/site-packages > > Well, this isn't working for me. > > Could someone please provide some help ? > > Thanks. ------------------------------------------------------------------------------ Sponsored by Intel(R) XDK Develop, test and display web and hybrid apps with a single code base. Download it for free now! http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk _______________________________________________ PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net) Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net