From: Ryan Pavlovicz (pavlovicz.7_at_osu.edu)
Date: Thu Oct 09 2008 - 22:10:44 CDT

Thanks for the response, Axel.

I am running VMD for LINUXAMD64, version 1.8.6. My AMD x86_64 workstation
is running SUSE 10.1 Linux.
What do you mean by installing the "matching" python installation.

I see in the documentation that:

VMD is not distributed with an entire Python environment. In order to use
the set of libraries that normally come with a Python distribution, you must
tell Python where to find the libraries. There are two primary means of
doing this. The PYTHONHOME environment variable points to the location where
Python is installed; the version installed at this point must match VMD's
version (2.2). Thus if you have Python libraries in
/usr/local/lib/python2.2, adding the line set env(PYTHONHOME) /usr/local to
your startup script or .vmdrc file will do the trick.

I am running python 2.5.1 and 2.5.2 on my machine, not v 2.2, so is the main
problem? Should the higher versions of python not be back-compatible? Or
can i compile VMD to work with my system python (2.5)? If so, how? Thanks
again,

-ryan

On Thu, Oct 9, 2008 at 5:31 PM, Axel Kohlmeyer
<akohlmey_at_cmm.chem.upenn.edu>wrote:

> 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.
>