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

Please see below

On Jul 26, 2008, at 2:57 AM, Martin Landa wrote:

Hi,

2008/7/25 Michael Barton <michael.barton@asu.edu>:

I commented out the CheckForWx() line in globalvar.py and got the following
message...

do you mean?

http://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/gui_modules/globalvar.py#L52

This function is also called

gis_set.py:globalvar.CheckForWx()
gui_modules/menuform.py:globalvar.CheckForWx()
gui_modules/dbm.py:globalvar.CheckForWx()
gui_modules/globalvar.py:def CheckForWx():
gui_modules/globalvar.py:CheckForWx()
wxgui.py:globalvar.CheckForWx()

ERROR: wxversion.select() must be called before wxPython is imported.
wxPython >= 2.8.1.1 is required. Detailed information in README file.
I can upgrade. But is this a good idea? Have you added something that only
works in the most recent version?

Did you modify CheckForWx()? You need to call import wxversion before
you call wxversion.select()...

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.

Michael

if it's still not working for you, you should ask at wxPython ML. I
remember a few weeks ago we tried to solved it -- but you didn't
follow wxPython ML, see

http://lists.wxwidgets.org/pipermail/wxpython-users/2008-July/077605.html

Regards, Martin

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa *

Micheal,

2008/7/26 Michael Barton <michael.barton@asu.edu>:

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.

I changed CheckForWx() to use wx.version() instead of wx.__version__.
Hope it helps.

http://trac.osgeo.org/grass/changeset/32313

and

http://trac.osgeo.org/grass/changeset/32314

Martin

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa *

On Jul 26, 2008, at 2:32 PM, Michael Barton wrote:

ERROR: wxversion.select() must be called before wxPython is imported.
wxPython >= 2.8.1.1 is required. Detailed information in README file.
I can upgrade. But is this a good idea? Have you added something that only
works in the most recent version?

Um, wxpython 2.8.1.1 now required? Any particular reason? OSX 10.5 has 2.8.0.1, and I'd prefer to stay with the system python on OSX 10.5. Of course, I use the python.org Python on OSX 10.4, so I can installl whatever wxpython I may need.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"History is an illusion caused by the passage of time, and time is an illusion caused by the passage of history."

- Hitchhiker's Guide to the Galaxy

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@gclements.plus.com>

Hi,

2008/7/27 Glynn Clements <glynn@gclements.plus.com>:

[snip]

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().

AFAIU, that's CheckForWx() should do

http://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/gui_modules/globalvar.py#L27

Martin

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa *

On Jul 26, 2008, at 4:07 PM, Glynn Clements wrote:

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().

Maybe I misunderstand, but this is what we want. We need to know that the default version of wx is at or above 2.8.1. So it doesn't matter if you have 2.6 and 2.8.1, if 2.6 is your default,

import wx
wx.version()

should say that 2.6 is running, which is the wrong version. This should generate an error out of CheckForWx().

Michael

A little more investigation has shown this. The following code does not work on a Mac with new versions of wxPython.

def CheckForWx():
     """Try to import wx module and check its version"""

     majorVersion = 2.8
     minorVersion = 1.1

     try:
         import wxversion
         wxversion.select(str(majorVersion))
         import wx

The problem lies in wxversion.select. It is looking for the SOURCE CODE files in a BINARY wxPython installation. They simply are not there. Here is what happens if I run this in the Python interpreter.

>>> import wx
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "//Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx/__init__.py", line 45, in <module>
   File "//Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx/_core.py", line 4, in <module>
ImportError: No module named _core_
>>>

Note, it is checking for _core.py.
I have _core.pyo and _core.pyc, but not the source _core.py. I don't have any source files in this binary installation. It works fine and takes up less space I suppose. But this sequence ...

import wxversion
wxversion.select(str(majorVersion))
import wx

...fails not because I have the wrong version, but because I do not have the SOURCE files that it uses to check for the version. This is a bug in wxversion. It should be looking for _core.*, not a specific source file _core.py. If I disable version checking by putting a return at the beginning of CheckForWx(), wxgui loads and runs fine. But we should have a version check (though I don't know if we need to check it in so many modules; at startup should be enough.

The following code works fine.

def CheckForWx():
     """Try to import wx module and check its version"""

     majorVersion = 2.8
     minorVersion = 1.1

     try:
         #import wxversion
         #wxversion.select(str(majorVersion))
         import wx
         version = wx.version().split(' ')[0]
         if float(version[:3]) < majorVersion:
             raise ValueError('You are using wxPython version %s' % str(version))
         if float(version[:3]) == 2.8 and \
                 float(version[4:]) < minorVersion:
             raise ValueError('You are using wxPython version %s' % str(version))

This checks to make sure that the default wxpython installation is 2.8.1.1 or higher. If not, it throws an error and does not load wxgui.

Michael

On Jul 26, 2008, at 12:42 PM, Martin Landa wrote:

Micheal,

2008/7/26 Michael Barton <michael.barton@asu.edu>:

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.

I changed CheckForWx() to use wx.version() instead of wx.__version__.
Hope it helps.

Changeset 32313 – GRASS GIS

and

Changeset 32314 – GRASS GIS

Martin

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa *

Hi,

2008/7/26 William Kyngesburye <woklist@kyngchaos.com>:

[...]

Um, wxpython 2.8.1.1 now required? Any particular reason? OSX 10.5 has
2.8.0.1, and I'd prefer to stay with the system python on OSX 10.5. Of
course, I use the python.org Python on OSX 10.4, so I can installl whatever
wxpython I may need.

This version is recommended in README from very beginning. 2.8.0.1 is
maybe enough, I just remember there was a bug in < 2.8.1.1, maybe
Michael remember better. We can downgrade required version to 2.8.0.0
if you like.

Martin

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa *

Hi,

2008/7/27 Michael Barton <michael.barton@asu.edu>:

[...]

   try:
       import wxversion
       wxversion.select(str(majorVersion))
       import wx

The problem lies in wxversion.select. It is looking for the SOURCE CODE
files in a BINARY wxPython installation. They simply are not there. Here is
what happens if I run this in the Python interpreter.

import wx

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"//Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx/__init__.py",
line 45, in <module>
File
"//Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx/_core.py",
line 4, in <module>
ImportError: No module named _core_

Note, it is checking for _core.py.
I have _core.pyo and _core.pyc, but not the source _core.py. I don't have
any source files in this binary installation. It works fine and takes up
less space I suppose. But this sequence ...

import wxversion
wxversion.select(str(majorVersion))
import wx

...fails not because I have the wrong version, but because I do not have the
SOURCE files that it uses to check for the version. This is a bug in
wxversion. It should be looking for _core.*, not a specific source file
_core.py. If I disable version checking by putting a return at the beginning
of CheckForWx(), wxgui loads and runs fine. But we should have a version
check (though I don't know if we need to check it in so many modules; at
startup should be enough.

The following code works fine.

def CheckForWx():
   """Try to import wx module and check its version"""

   majorVersion = 2.8
   minorVersion = 1.1

   try:
       #import wxversion
       #wxversion.select(str(majorVersion))
       import wx
       version = wx.version().split(' ')[0]
       if float(version[:3]) < majorVersion:
           raise ValueError('You are using wxPython version %s' %
str(version))
       if float(version[:3]) == 2.8 and \
               float(version[4:]) < minorVersion:
           raise ValueError('You are using wxPython version %s' %
str(version))

This checks to make sure that the default wxpython installation is 2.8.1.1
or higher. If not, it throws an error and does not load wxgui.

Michael, I can just repeat what I said, wxPython ML is right place
where to ask how to solve this problem. Calling wxversion.select() is
important here since you can have 2.6 and 2.8 installed on your
computer. At least on Debian it's quite likely...

Martin

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa *

On Jul 27, 2008, at 1:18 AM, Martin Landa wrote:

Hi,

2008/7/27 Michael Barton <michael.barton@asu.edu>:

[...]

  try:
      import wxversion
      wxversion.select(str(majorVersion))
      import wx

The problem lies in wxversion.select. It is looking for the SOURCE CODE
files in a BINARY wxPython installation. They simply are not there. Here is
what happens if I run this in the Python interpreter.

import wx

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"//Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx/__init__.py",
line 45, in <module>
File
"//Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx/_core.py",
line 4, in <module>
ImportError: No module named _core_

Note, it is checking for _core.py.
I have _core.pyo and _core.pyc, but not the source _core.py. I don't have
any source files in this binary installation. It works fine and takes up
less space I suppose. But this sequence ...

import wxversion
wxversion.select(str(majorVersion))
import wx

...fails not because I have the wrong version, but because I do not have the
SOURCE files that it uses to check for the version. This is a bug in
wxversion. It should be looking for _core.*, not a specific source file
_core.py. If I disable version checking by putting a return at the beginning
of CheckForWx(), wxgui loads and runs fine. But we should have a version
check (though I don't know if we need to check it in so many modules; at
startup should be enough.

The following code works fine.

def CheckForWx():
  """Try to import wx module and check its version"""

  majorVersion = 2.8
  minorVersion = 1.1

  try:
      #import wxversion
      #wxversion.select(str(majorVersion))
      import wx
      version = wx.version().split(' ')[0]
      if float(version[:3]) < majorVersion:
          raise ValueError('You are using wxPython version %s' %
str(version))
      if float(version[:3]) == 2.8 and \
              float(version[4:]) < minorVersion:
          raise ValueError('You are using wxPython version %s' %
str(version))

This checks to make sure that the default wxpython installation is 2.8.1.1
or higher. If not, it throws an error and does not load wxgui.

Michael, I can just repeat what I said, wxPython ML is right place
where to ask how to solve this problem. Calling wxversion.select() is
important here since you can have 2.6 and 2.8 installed on your
computer. At least on Debian it's quite likely...

I understand that using wxversion can help to ensure that some (but not all) systems with multiple versions will load the correct one. Nonetheless, there is a bug in wxversion that makes it fail on systems that DO have the correct version. This is a more serious problem because it affects anyone who has a binary installation of wxpython (most people) that does not include the wxpython source files along with the object files (at least all Mac users currently and possibly others).

Trying to find a workaround on the wxPython mailing list or other place is good, but my experience has been that responses are erratic and sometimes very slow. It can take quite a while until a developer actually believes that someone even has a problem. This was the case with the initial response you received on this issue. It was certainly the case with the bug in adding widgets to AUI menubars on the Mac.

Until this is solved, CheckForWx using wxversion does not work on the Mac platform--or on ANY system that has a binary installation of wxPython that lacks the source file _core.py. A version check is good, but not when it incorrectly disables the GUI on an entire platform. There are several other new additions that only work on Linux. We need to work to keep this cross-platform. I'm happy to search for and to try out other solutions to this particular issue. However, at this stage, a version check that is only partly reliable (or even no version check at all) is better than one that prevents the GUI from running on systems with correct installations.

This change to CheckForWx at least does a version check on the default wx. But if you think it is better, we can simply disable CheckForWx entirely.

Michael

Hi Michael,

2008/7/27 Michael Barton <michael.barton@asu.edu>:

Trying to find a workaround on the wxPython mailing list or other place is
good, but my experience has been that responses are erratic and sometimes
very slow. It can take quite a while until a developer actually believes

I do not agree here, wxPython mailing list in the concrete is not that
case. *Not erratic and not slow*, at least you get very useful answer
from Robin Dunn in one day...

Until this is solved, CheckForWx using wxversion does not work on the Mac
platform--or on ANY system that has a binary installation of wxPython that
lacks the source file _core.py. A version check is good, but not when it

In the past I asked on wxPython ML, see

http://lists.wxwidgets.org/pipermail/wxpython-users/2008-July/077605.html

http://lists.wxwidgets.org/pipermail/wxpython-users/2008-July/077611.html

http://lists.wxwidgets.org/pipermail/wxpython-users/2008-July/077618.html

Best, Martin

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa *

Martin Landa wrote:

> 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().

AFAIU, that's CheckForWx() should do

http://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/gui_modules/globalvar.py#L27

Right.

BTW, you can use inequality operators on lists, so you can compare
hierarchical version numbers with e.g.:

  version = wx.version().split(' ')[0]
  if map(int,version.split('.')) < [2,8,1,1]:
    raise ...

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

Michael Barton wrote:

> 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().

Maybe I misunderstand, but this is what we want. We need to know that
the default version of wx is at or above 2.8.1. So it doesn't matter
if you have 2.6 and 2.8.1, if 2.6 is your default,

import wx
wx.version()

should say that 2.6 is running, which is the wrong version. This
should generate an error out of CheckForWx().

Why would we want to use 2.6 and fail if you actually have 2.8?

AFAICT, if you have 2.8, we should use 2.8. It shouldn't matter what
the default is, or if you even have a default (a default should only
be required for code which pre-dates the addition of the wxverion
module).

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

Michael Barton wrote:

A little more investigation has shown this. The following code does
not work on a Mac with new versions of wxPython.

def CheckForWx():
     """Try to import wx module and check its version"""

     majorVersion = 2.8
     minorVersion = 1.1

     try:
         import wxversion
         wxversion.select(str(majorVersion))
         import wx

The problem lies in wxversion.select. It is looking for the SOURCE
CODE files in a BINARY wxPython installation. They simply are not
there. Here is what happens if I run this in the Python interpreter.

>>> import wx
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "//Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/wx-2.8-mac-unicode/wx/__init__.py", line 45,
in <module>
   File "//Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/wx-2.8-mac-unicode/wx/_core.py", line 4, in
<module>
ImportError: No module named _core_
>>>

Note, it is checking for _core.py.

No it isn't. Look at the error message:

  ImportError: No module named _core_

It's looking for a module name _core_ (with a trailing underscore).
This is the binary extension (_core_.so on Linux). It should be in

The files listed in the backtrace are the Python files which were
being executed at the point that the error occurred. The backtrace
always refers to the .py files even if .pyc or .pyo files are actually
used.

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

On Jul 27, 2008, at 3:14 AM, Martin Landa wrote:

Hi,

2008/7/26 William Kyngesburye <woklist@kyngchaos.com>:

[...]

Um, wxpython 2.8.1.1 now required? Any particular reason? OSX 10.5 has
2.8.0.1, and I'd prefer to stay with the system python on OSX 10.5. Of
course, I use the python.org Python on OSX 10.4, so I can installl whatever
wxpython I may need.

This version is recommended in README from very beginning. 2.8.0.1 is
maybe enough, I just remember there was a bug in < 2.8.1.1, maybe
Michael remember better. We can downgrade required version to 2.8.0.0
if you like.

Martin

Sorry, wrong wx. I looked at the wx libraries. wxpython on OSX 10.5 is 2.8.4.0.

sorry for the noise.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

[Trillian] What are you supposed to do WITH a maniacally depressed robot?

[Marvin] You think you have problems? What are you supposed to do if you ARE a maniacally depressed robot? No, don't try and answer, I'm 50,000 times more intelligent than you and even I don't know the answer...

- HitchHiker's Guide to the Galaxy

Hi,

2008/7/27 Glynn Clements <glynn@gclements.plus.com>:

[...]

AFAIU, that's CheckForWx() should do

http://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/gui_modules/globalvar.py#L27

Right.

BTW, you can use inequality operators on lists, so you can compare
hierarchical version numbers with e.g.:

       version = wx.version().split(' ')[0]
       if map(int,version.split('.')) < [2,8,1,1]:
               raise ...

thanks, committed

http://trac.osgeo.org/grass/changeset/32338

and

http://trac.osgeo.org/grass/changeset/32339

Martin

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa *

Hi,

2008/7/27 Glynn Clements <glynn@gclements.plus.com>:

[...]

Maybe I misunderstand, but this is what we want. We need to know that
the default version of wx is at or above 2.8.1. So it doesn't matter
if you have 2.6 and 2.8.1, if 2.6 is your default,

import wx
wx.version()

should say that 2.6 is running, which is the wrong version. This
should generate an error out of CheckForWx().

Why would we want to use 2.6 and fail if you actually have 2.8?

AFAIU we don't want to use 2.6, required version is >= 2.8.1.1.

AFAICT, if you have 2.8, we should use 2.8. It shouldn't matter what
the default is, or if you even have a default (a default should only
be required for code which pre-dates the addition of the wxverion
module).

yes, wxversion.select() is just called before 'import wx' to be sure
that selected version of wxPython is 2.8 in the case you have more
than one version of wxPython installed (e.g. 2.6 and 2.8).

Martin

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa *

Hi,

2008/7/27 Glynn Clements <glynn@gclements.plus.com>:

[...]

   File "//Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/wx-2.8-mac-unicode/wx/_core.py", line 4, in
<module>
ImportError: No module named _core_
>>>

Note, it is checking for _core.py.

No it isn't. Look at the error message:

       ImportError: No module named _core_

It's looking for a module name _core_ (with a trailing underscore).
This is the binary extension (_core_.so on Linux). It should be in

The files listed in the backtrace are the Python files which were
being executed at the point that the error occurred. The backtrace
always refers to the .py files even if .pyc or .pyo files are actually
used.

Michael, please check your wxPython installation (Robin Dunn's answer
[1]). There's no reason why the statements below should fail

import wxversion
wxversion.select('2.8')
import wx

Regards, Martin

[1] http://lists.wxwidgets.org/pipermail/wxpython-users/2008-July/077618.html

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa *

On Jul 27, 2008, at 10:49 AM, Martin Landa wrote:

Hi,

2008/7/27 Glynn Clements <glynn@gclements.plus.com>:

[...]

  File "//Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/wx-2.8-mac-unicode/wx/_core.py", line 4, in
<module>
ImportError: No module named _core_

Note, it is checking for _core.py.

No it isn't. Look at the error message:

      ImportError: No module named _core_

It's looking for a module name _core_ (with a trailing underscore).
This is the binary extension (_core_.so on Linux). It should be in

The files listed in the backtrace are the Python files which were
being executed at the point that the error occurred. The backtrace
always refers to the .py files even if .pyc or .pyo files are actually
used.

Michael, please check your wxPython installation (Robin Dunn's answer
[1]). There's no reason why the statements below should fail

import wxversion
wxversion.select('2.8')
import wx

Regards, Martin

[1] http://lists.wxwidgets.org/pipermail/wxpython-users/2008-July/077618.html

This finally worked.

I've been following all the wxpython install/uninstall instructions to no avail. I looked at Robin's email responses you forwarded to me, but didn't see this one some how. Thanks for bringing it to my attention. I'm glad you've had better luck with responses than I have. I've reported a couple of well-documented bugs with the Mac version. Eventually I got work-arounds or solutions for some of these, but it took several months. I just figured that the development team was overloaded.

The issue is that now wxpython is supposed to be installed in a different place on disk than it has been up through 2.8.7.1. The install routine will not install into this new location unless you manually remove all prior versions. Otherwise, it will install into the prior location completely correctly, but giving bogus errors when you run wxversion. Nor does the wxpython uninstall remove the old location. So there is a problem in the wxpython installation routine. I don't know if this also affects Windows or just the Mac. But it will affect everyone on Macs who upgrade.

Michael