[Distutils] Multiple version support (default installs and plugins)

M.-A. Lemburg mal at egenix.com
Thu Dec 22 12:36:12 CET 2005

Ian Bicking wrote:
> I'm still finding it impossible to use multiple versions of a package 
> unless none of them show up in a .pth file (i.e., none are available 
> without requiring), I get a VersionConflict. 

This comes up every now and then when discussing the benefits
of easy_install.

I'd really like to understand what the use case is for having
multiple versions of a package around.

Note that sys.modules (the registry of loaded modules) does
not support having multiple versions of a module loaded.

Even if you do trick Python into loading a module twice,
either by mistake or on purpose, you end up with only
one being referenced in sys.modules.

Having a module loaded twice (the same or different versions)
will cause lots of very subtle problems with various mechanisms
in Python, e.g. Python pickles may get loaded using the wrong
module, classes may reference the wrong module (causing
isinstance() or issubclass() tests to fail without apparent
reason), initialization code may have been applied twice
which could lead to duplication (e.g. if you append data
to a list during initialization), etc.

Marc-Andre Lemburg

Professional Python Services directly from the Source  (#1, Dec 22 2005)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::

More information about the Distutils-SIG mailing list