From: John Stone (
Date: Sat Jan 10 2004 - 17:32:00 CST

Hi Simon,
  I suspect that as you suggest, your VMD is finding the Python
modules you've installed previously with 'fink'. I'm guessing
that its finding them as a result of 'fink' probably setting
up PYTHONHOME and PYTHONPATH variables in your .cshrc or other
login files. There's a information about this in the VMD
User's Guide as well:

I believe it is true that the Python interpreter built-into the MacOS X
version of VMD doesn't have Tk linked in at present, which would explain
why it yields errors when trying to use the python modules its finding
that were setup by 'fink'. I'm hoping to spend some time upgrading
the Python interpreter in VMD and enabling more of these commonly-used
modules before we release the next version, which ought to make life
a little easier for people working with the latest-and-greatest Python
stuff. First order of business is to update Tcl/Tk on MacOS X as I think
it will fix some Tk problems that exist in the one we're using now, but
then I'll see what I can do about updating Python.


On Fri, Jan 09, 2004 at 12:06:00AM +0100, simon stockes wrote:
> Hi All,
> I'd just installed vmd-1.8.2 on mac osx and I got the following error
> when I launched "gopython". Here are some reflexions and questions
> about the problem :
> vmd > gopython
> Info) Starting Python...
> Info) Text interpreter now Python
> Traceback (most recent call last):
> File "<string>", line 1, in ?
> File "/sw/lib/python2.2/lib-tk/", line 35, in ?
> import _tkinter # If this fails your Python may not be configured
> for Tk
> ImportError: Failure linking new module
> * It seems vmd has its own Python Interpreter (build-in during
> compilation).
> >>> import sys
> >>> sys.version
> '2.2.1 (#1, Sep 23 2002, 10:06:53) \n[GCC 2.95.2 19991024 (release)]'
> * Indeed, I have no Python 2.2.1 interpreter on my machine, only a
> Python2.2.2
> >>> import sys
> >>> sys.version
> '2.2.2 (#1, 04/19/03, 23:43:12) \n[GCC Apple cpp-precomp 6.14]'
> * I think the 2.2.1 interpreter find external python libraries in my
> fink 2.2.2 distribution cause the sys.path of vmd give me this result :
> >>> sys.path
> ['/Applications/Sciences/vmd-1.8.2/VMD
> '/Applications/Sciences/vmd-1.8.2/VMD
>', '/sw/lib/python2.2',
> '/sw/lib/python2.2/plat-darwin', '/sw/lib/python2.2/lib-tk',
> '/sw/lib/python2.2/lib-dynload', '/sw/lib/python2.2/site-packages',
> '/sw/lib/python2.2/site-packages/Numeric']
> *I have question : How vmd set these paths. I don't remenber to give
> this information ?
> *As you can see the '/sw/lib/python2.2/lib-dynload' path is present in
> the list and contain So, why the error with 'import
> _tkinter' with 'gopython' ?
> Read you,
> Simon.

NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email:                 Phone: 217-244-3349              
  WWW:      Fax: 217-244-6078