Hi,

Being new to python scripting, I am facing a simple problem.

I am writing a python script "MyScript.py" in which I am calling the third-part program PyMOL through the import function.

Here is the simplified script (mainly inspired from this blog: http://doeidoei.wordpress.com/2009/02/11/pymol-api-simple-example/)

```
#! /usr/bin/python
# Usage: MyScript.py <input>

# launch PyMOL from the terminal
import __main__
__main__.pymol_argv = [ 'pymol', '-qc']

import sys
import pymol

pymol.finish_launching()

# Input
file = sys.argv[1]

#run PyMOL command
pymol.cmd.do("load %s" % file)

#Exit PyMOL
pymol.cmd.quit()
```

I get this error message:

```
Traceback (most recent call last):
  File "./MyScript.py", line 10, in <module>
    import pymol
ImportError: No module named pymol
```

My path to Python site-packages: `/Library/Python/2.7/site-packages`

My path to PyMOL: `/Users/me/my_apps/MacPyMOL_1.3.app/Contents/MacOS/MacPyMOL`

(I made an alias `pymol='MacPyMOL'` in `.bash_profile`)

I also tried to replace in the script:

```
import sys
import pymol
```

by

```
import sys
sys.path.append("/Users/me/my_apps/MacPyMOL_1.3.app/Contents/MacOS")
import MacPyMOL
```

but still the same.

I looked at other forums but it didn't solve the problem:

 - https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=CCP4BB;24c8090b.1011
 - https://www.mail-archive.com/pymol-users@lists.sourceforge.net/msg08176.html

If someone could direct me to a solution...

Thanks!
Hi,

In MacOSX with a default installation of MacPymol you cannot use the API because there is no _cmd.so file. What I usually do it to install pymol via fink/macports or compile it from source somewhere. Not the best solution but then you can get the file you are missing.

If you manage to find a better solution, it'd be great to share !