[GRASS-dev] python2/3 and GRASS build on Arch

Glynn Clements glynn at gclements.plus.com
Thu Oct 9 05:56:22 PDT 2014

Maciej Sieczka wrote:

> Is using a mix of wxPython 2.8 and 3.0 like this going to pose any usage 
> problems in core GRASS or plugins?

Probably not. Using different versions in different processes won't
matter. And if one module imports another, I believe that the module
which actually loads wx (i.e. the first one to execute "import wx")
will determine the version; subsequent "import wx" statements will use
the already-loaded version.

> Could GRASS offer a mechanism to enforce a specific wxPython version 
> throughout all of GRASS build and run time? Or how to hack it in a more 
> elegant way than patching those ~140 *.py files which import wx?

One option would be to replace "import wx" with "import grass.wx",
where the grass.wx module is just

	from wx import *

The other option is to only add wxversion.select() to top-level
modules, i.e. those which are executed as scripts rather than imported
as modules.

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-dev mailing list