install/import modules, /site-packages

Randy Heiland heiland at ncsa.uiuc.edu
Fri Apr 25 11:03:09 EDT 2003


I need some basic Python module knowledge.  On my RH Linux installation, 
I've got the following:

/usr/local/lib/python2.2/xml
and
/usr/local/lib/python2.2/site-packages/_xmlplus

and when I >>> import xml.sax, I get:
'/usr/local/lib/python2.2/site-packages/_xmlplus/sax/__init__.pyc'

How does this module (in site-packages) take precedence over the other? 
  (I got _xmlplus by installing PyXML).  This relates to an earlier post 
of mine regarding:
AttributeError: SAX_expat instance has no attribute 'setContentHandler'


I also have:
 >>> print sys.path
['', '/home/heiland/xml_parse_test', '/usr/local/lib/python2.2', 
'/home/heiland/vtk_Dec17.02/VTK/bin', 
'/home/heiland/vtk_Dec17.02/VTK/Wrapping/Python', 
'/usr/local/lib/python2.2/plat-linux2', 
'/usr/local/lib/python2.2/lib-tk', 
'/usr/local/lib/python2.2/lib-dynload', 
'/usr/local/lib/python2.2/site-packages']

thanks for any insight and/or doc link,
--Randy





More information about the Python-list mailing list