From: Axel Kohlmeyer (akohlmey_at_cmm.chem.upenn.edu)
Date: Thu Oct 09 2008 - 16:31:13 CDT

On Thu, 9 Oct 2008, Ryan Pavlovicz wrote:

ryan,

RP> Hi. I am having trouble loading python in VMD and am wondering if someone
RP> can help me out.

not as such. vital pieces of information are missing:
- what version of VMD do you use?
- what operating system do you use?
- have you installed the "matching" python installation.
  VMD does usually not work with the system python.
 

RP> When executing VMD from the command line with:
RP>
RP> >VMD -python
RP>
RP> Python will load, but with the following error messages:
RP>
RP> 'import site' failed; use -v for traceback
RP> Could not find Numeric Python version >= 22.0
RP> ImportError: No module named numeric_version
RP> Info) Text interpreter now Python
RP> Traceback (most recent call last):
RP> File "<string>", line 1, in ?
RP> File "/usr/local/lib/vmd/scripts/python/Tkinter.py", line 62, in ?
RP> from types import *
RP> ImportError: No module named types
RP>
RP> from there i can import VMD without any problems, but cannot import other
RP> modules such as numpy or fileinput.
RP>
RP> If i exit out of this python session, then type 'python' in the vmd console,
RP> VMD loads cleanly, however i cannot import the VMD module.
RP>
RP> vmd >python

please note, that this will start the general system
python interpreter as a subprocess and will halt VMD until
you return from it. to get access to the embedded python
interpreter you have to type "gopython" (see the VMD documentation).

RP> Python 2.5.1 (r251:54863, Sept 25 2007, 17:59:18)
RP> [GCC 4.1.0 (SUSE Linux)] on linux2
RP> >>> import VMD
RP> Traceback (most recent call last):
RP> File "<stdin>", line 1, in <module>
RP> File "/usr/local/lib/vmd/scripts/python/VMD.py", line 27, in <module>
RP> import animate
RP> ImportError: No module name animate

this is a different issue. i am not certain, whether actually
importing VMD's python module into a system python interpreter
is completely working. if at all that probably only for the
latest beta versions. nevertheless, your python interpreter
has to be compatible with the one used to compile VMD and that
is usually not the case. only the very latest test versions of
VMD use python 2.5 for example...

to make VMD compatible with the system python installation, you
will have to compile VMD from source and adjust the VMD build
scripts accordingly.

cheers,
   axel.

RP>
RP> Any suggestions on how to get python working with VMD cleanly? Thanks in
RP> advance,
RP>
RP> ryan
RP>

-- 
=======================================================================
Axel Kohlmeyer   akohlmey_at_cmm.chem.upenn.edu   http://www.cmm.upenn.edu
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.