From: Axel Kohlmeyer (akohlmey_at_gmail.com)
Date: Mon Jan 23 2012 - 16:33:29 CST

On Mon, Jan 23, 2012 at 4:36 PM, Wim R. Cardoen <wcardoen_at_gmail.com> wrote:
> Hello,
>
> I compiled vmd version 1.9 from source (advised by Dr. Stone when heavy
> python use is prevalent)
> The configure options were:
> LINUXAMD64 FLTK TK NETCDF TCL PYTHON PTHREADS NUMPY
>
> However, when I invoke the python script trial.py in vmd:
> 'vmd -dispdev text -python -e trial.py'
> of which the first lines are:
>
> -----------------------------------------------------------------------------------
> import sys
> import optparse
> from atomsel import *
> from atomsel import AtomSel
> from Molecule import Molecule
> from VMD import evaltcl
> --------------------------------------------------------------------------------
>
> I immediately get the following error:
> --------------------------------------------------------------------------------
> vmd -dispdev text -python -e trial.py
> Info) VMD for LINUXAMD64, version 1.9 (January 23, 2012)
> Info) http://www.ks.uiuc.edu/Research/vmd/
> Info) Email questions and bug reports to vmd_at_ks.uiuc.edu
> Info) Please include this reference in published work using VMD:
> Info)    Humphrey, W., Dalke, A. and Schulten, K., `VMD - Visual
> Info)    Molecular Dynamics', J. Molec. Graphics 1996, 14.1, 33-38.
> Info) -------------------------------------------------------------
> Info) Multithreading available, 8 CPUs detected.
> Info) Free system memory: 11100MB (92%)
> Info) Starting Python...
> Info) Text interpreter now Python
> Traceback (most recent call last):
>   File "VMD", line 7, in <module>
> ImportError: cannot import name AtomSel
> ----------------------------------------------------------------------------------
>
> The python script AtomSel.py is present in the  lib/vmd/scripts/python
> subdirectory of vmd.
>
>
> Any suggestions?

AtomSel is not part of the "atomsel" module
(which you already had imported completely),
but its own module. so the line

from atomsel import AtomSel

would have to be

from AtomSel import AtomSel

but keep in mind, that AtomSel is deprecated,
so you should not use it at all in any new scripts.

cheers,
    axel.

>
> Thanks,
>
> Wim

-- 
Dr. Axel Kohlmeyer
akohlmey_at_gmail.com  http://goo.gl/1wk0
College of Science and Technology
Temple University, Philadelphia PA, USA.