ImportError: No module named Foo
Up to table of contentsThis FAQ applies to: 1.5.2
This ImportError means that Python interpreter can't find appropriate packages from MGLTools. Please run these scripts using pythonsh (e.g. pythonsh prepare_ligand.py) located in:
Linux $MGL_ROOT/bin, where $MGL_ROOT is either /usr/local/MGLTools-1.5.2 or $HOME/MGLTools-1.5.2
Mac OS X
/Library/MGLTools/1.5.2/bin
Windows users: our installer creates/modifies C:\Python25\Lib\sitecustomize.py and you should be able to run prepare_ligand.py as follows:
C:\Python25\python.exe prepare_ligand.py
Python Path
pythonsh is a shell script that sets appropriate environment variables, such as
PYTHONPATH, before starting python. If you are planning to use MGLTools for
virtual screening only, i.e. no GUI mode, then you need to build or
compile MGLTools, since only platform independent code is used for VS tutorial.
You do need, however, numpy installed on your system. Here are steps needed to make sure that you can import all MGLTools packages.
- Download any of the binary tarballs, e.g.
-
Unpack MGLToolsPckgs
tar -xzvf mgltools_i86Linux2_1.5.2.tar.gz
cd mgltools_i86Linux2_1.5.2
tar -xzvf MGLToolsPckgs.tar.gz -
Set PYTHONPATH environment variable.
setenv PYTHONPATH `pwd`/MGLToolsPckgs
How to set up PYTHONPATH on Windows?
http://mgltools.scripps.edu/downloads/tars/releases/REL1.5.2/mgltools_i86Linux2_1.5.2.tar.gz
Update: http://eflorenzano.com/blog/post/first-two-django-screencasts shows another method using symbolic links.
See also: http://autodock.scripps.edu/faqs-help/how-to/how-to-setup-adt-scripts
