[GRASS-dev] Re: requiring 2.8.1.1???

Glynn Clements glynn at gclements.plus.com
Sat Jul 26 19:07:43 EDT 2008


Michael Barton wrote:

> > Just try in python
> >
> >>>> import wxversion
> >>>> wxversion.select(str(2.8))
> >>>> import wx
> >>>> wx.__version__
> > '2.8.8.1'
> 
> This version check is failing with 2.8.8.0 on the Mac even if the  
> correct version is installed. It may be failing with other version  
> too.  wx.__version__ looks for wxpython SOURCE (*.py) files that are  
> not currently being included in the wxpython binary installer for some  
> reason. The object files are correct and being installed (*.pyo).
> 
> Why not just use wx.version()? It gives the correct response  
> regardless of whether the source files are installed or not.

wxversion doesn't *check* for a particular version, it *chooses* a
particular version.

If you use wxversion.select(), you only need to have that particular
version installed.

OTOH, if you "import wx" without using wxversion.select(), then check
wx.version(), the desired version not only needs to be installed, it
also needs to be the default version (i.e. installed as "wx").

So, if you have e.g. both 2.6 and 2.8, and "wx" is 2.6, the code will
fail without the use of wxversion.select().

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list