Dealing with multiple versions of packages...

Rob Nikander rnikaREMOVEnder at adelphia.net
Tue Apr 20 23:54:12 EDT 2004


I haven't heard of a standard way to do it.

I downloaded PyGTK 2.0.x a while back and I remember looking at a 
package structure that looked like it was designed to do this.  You 
might want to check that for ideas.  (I don't have it on my machine now.)

Also I was using a python module today that behaved differently upon 
import, depending on a property of "sys".  Like:

import sys
sys.coinit_flags = 0
import pythoncom # initializes COM with sys.coinit_flags

In your case wx could be a package with an __init__.py that imported 
subpackages depending on what version was set (with a default of 
course).  To import packages based on a string variable you have to use 
__import__.

You could also set PYTHONPATH to the version you want. ?

Rob




More information about the Python-list mailing list