ADL: Porting ADT scripts to Linux Binaries

Jack Shultz jackygrahamez at gmail.com
Mon Oct 8 08:43:40 PDT 2007


Hello AutoDockers!

I got some advice on this issue, but still don't understand how to import
MolKit module into python. I've tried it several ways first with pyinstaller
then with cx Freeze
1) Pyinstaller I tried it first with python and using path=directory of
MolKit, then I tried it using pythonsh because I figured that would do all
the necessary imports. It generated the error bellow.
2) Then I tried Sargis suggestion on cx freeze, but I ended up with the
familare message about "ImportError: No module named MolKit"

Any suggestions appreciated!

Jack

setting PYTHONHOME environment
I: computing EXE_dependencies
I: Finding TCL/TK...
I: found TCL/TK version 8.4
I: testing for Zlib...
I: ... Zlib available
I: Testing for Unicode support...
I: ... Unicode available
I: testing for UPX...
sh: upx: command not found
I: ...UPX unavailable
I: computing PYZ dependencies...
[root at vps pyinstaller-1.3]# pythonsh Makespec.py --onefile
/usr/local/MGLTools-1.4.6
/mgltools_i86Linux2_1.4.6/MGLToolsPckgs/AutoDockTools/Utilities24/prepare_ligand4.py
setting PYTHONHOME environment
wrote /root/pyinstaller-1.3/prepare_ligand4/prepare_ligand4.spec
now run Build.py to build the executable
[root at vps pyinstaller-1.3]# pythonsh Build.py /root/pyinstaller-1.3
/prepare_ligand4/prepare_ligand4.spec
setting PYTHONHOME environment
checking Analysis
building because support/useUnicode.py changed
running Analysis out0.toc
Analyzing: support/_mountzlib.py
Analyzing: support/useUnicode.py
Analyzing: /usr/local/MGLTools-1.4.6
/mgltools_i86Linux2_1.4.6/MGLToolsPckgs/AutoDockTools/Utilities24/prepare_ligand4.py
Syntax error in /usr/local/MGLTools-1.4.6
/mgltools_i86Linux2_1.4.6/MGLToolsPckgs/DejaVu/MaterialEditor.py
('invalid syntax',
('/usr/local/MGLTools-1.4.6/mgltools_i86Linux2_1.4.6/MGLToolsPckgs/DejaVu/MaterialEditor.py',
22, 1, '\r\n'))
Traceback (most recent call last):
  File "Build.py", line 839, in ?
    build(sys.argv[1])
  File "Build.py", line 76, in build
    exec open(spec, 'r').read()+'\n'
  File "<string>", line 2, in ?
  File "Build.py", line 112, in __init__
    self.__postinit__()
  File "Build.py", line 94, in __postinit__
    self.assemble()
  File "Build.py", line 182, in assemble
    analyzer.analyze_script(script)
  File "/root/pyinstaller-1.3/mf.py", line 379, in analyze_script
    return self.analyze_r('__main__')
  File "/root/pyinstaller-1.3/mf.py", line 299, in analyze_r
    newnms = self.analyze_one(name, nm, imptyp)
  File "/root/pyinstaller-1.3/mf.py", line 333, in analyze_one
    mod = self.doimport(nm, ctx, fqname)
  File "/root/pyinstaller-1.3/mf.py", line 392, in doimport
    mod = parent.doimport(nm)
  File "/root/pyinstaller-1.3/mf.py", line 515, in doimport
    mod = self.subimporter.getmod(nm)
  File "/root/pyinstaller-1.3/mf.py", line 216, in getmod
    mod = owner.getmod(nm)
  File "/root/pyinstaller-1.3/mf.py", line 71, in getmod
    co = compile(open(py[0], 'r').read()+'\n', py[0], 'exec')
  File "/usr/local/MGLTools-1.4.6/mgltools_i86Linux2_1.4.6/MGLToolsPckgs/DejaVu/MaterialEditor.py",
line 22

    ^
SyntaxError: invalid syntax


More information about the autodock mailing list