py3.4 and wx3, ImportError: No module named 'wxversion', release number mismatch etc

I can’t seem to create a usable Py3 tool chain.
I tried using pip, presumably getting wxPython_Phoenix-3.0.2.dev78075-cp34-none-win_amd64.whl
Suggestions?
Results below:

C:\Python34\Scripts>pip install --pre -f http://wxpython.org/Phoenix/snapshot-builds/ wxPython_Phoenix
Downloading/unpacking wxPython-Phoenix
http://wxpython.org/Phoenix/snapshot-builds/ uses an insecure transport scheme (http). Consider using https if wxpytho
n.org has it available
Installing collected packages: wxPython-Phoenix
Successfully installed wxPython-Phoenix
Cleaning up…

python
Python 3.4.2 (v3.4.2:ab2c023a9432, Oct 6 2014, 22:16:31) [MSC v.1600 64 bit (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.

wx.version
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘wx’ is not defined

import wxversion
Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named ‘wxversion’

import wx
C:\Python34\lib\site-packages\wx\core.py:22: UserWarning: wxPython/wxWidgets release number mismatch
warnings.warn(“wxPython/wxWidgets release number mismatch”)

wx.version
‘3.0.2.dev78075’

  • Ray

Hi,

...

>>> import wx
C:\Python34\lib\site-packages\wx\core.py:22: UserWarning: wxPython/wxWidgets release number mismatch
  warnings.warn("wxPython/wxWidgets release number mismatch")
>>> wx.__version__
'3.0.2.dev78075'

There is no wxversion for py3.

The release mismatch is 'just' a warning, you should be able to ignore it. IIRC Robin needs to update the Phoenix version to match the wxWidgets trunk version.

CC'ing the dev list, so hopefully Robin will see this.

Werner

···

On 11/3/2014 3:19, Ray S wrote:

Thanks -

Hi,

import wx

C:\Python34\lib\site-packages\wx\core.py:22: UserWarning:
wxPython/wxWidgets release number mismatch

warnings.warn(“wxPython/wxWidgets release number mismatch”)

wx.version

‘3.0.2.dev78075’

There is no wxversion for py3.

matplotlib seems to assume that there is, which is my real problem:

c:\python34\python
Python 3.4.2 (v3.4.2:ab2c023a9432, Oct 6 2014, 22:16:31) [MSC v.1600 64 bit (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.

from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigCanvas
Traceback (most recent call last):
File “c:\python34\lib\site-packages\matplotlib\backends\backend_wx.py”, line 54, in
import wxversion
ImportError: No module named ‘wxversion’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “”, line 1, in
File “c:\python34\lib\site-packages\matplotlib\backends\backend_wxagg.py”, line 10, in
from . import backend_wx # already uses wxversion.ensureMinimal(‘2.8’)
File “c:\python34\lib\site-packages\matplotlib\backends\backend_wx.py”, line 56, in
raise ImportError(missingwxversion)
ImportError: Matplotlib backend_wx and backend_wxagg require wxversion, which was not found.

The release mismatch is ‘just’ a warning, you should be able to ignore
it. IIRC Robin needs to update the Phoenix version to match the
wxWidgets trunk version.

I “fixed” that in core.py by commenting out line22:
warnings.warn(“wxPython/wxWidgets release number mismatch”)

I’m looking into the code in backend_wxagg.py

  • Ray
···

On Monday, 3 November 2014 00:50:11 UTC-8, werner wrote:

On 11/3/2014 3:19, Ray S wrote:

There is quit a bit to change in Matplotlib, see the following PR:
Not all is absolutely needed but it is probably easier to use it
instead of just doing the minimal changes to make it work with
wxPython Phoenix and Py3.
Werner

···

Hi,

  On 11/3/2014 20:31, Ray S wrote:

Thanks -

    On Monday, 3 November 2014 00:50:11 UTC-8, werner wrote:
      Hi,




      On 11/3/2014 3:19, Ray S wrote:


      ...


      > >>> import wx


      > C:\Python34\lib\site-packages\          wx\core.py:22:

UserWarning:

      > wxPython/wxWidgets release number mismatch


      >   warnings.warn("wxPython/          wxWidgets release number

mismatch")

      > >>> wx.__version__


      > '3.0.2.dev78075'


      >


      There is no wxversion for py3.
      matplotlib seems to assume that there is, which is my real

problem:

      >c:\python34\python

        Python 3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:16:31)

[MSC v.1600 64 bit (AMD64)] on win32

        Type "help", "copyright", "credits" or "license" for more

information.

        >>> from matplotlib.backends.backend_wxagg import

FigureCanvasWxAgg as FigCanvas

        Traceback (most recent call last):

          File

“c:\python34\lib\site-packages\matplotlib\backends\backend_wx.py”,
line 54, in

            import wxversion

        ImportError: No module named 'wxversion'





                  During

handling of the above exception, another exception occurred:

                      Traceback

(most recent call last):

            File "<stdin>", line 1, in <module>

            File

“c:\python34\lib\site-packages\matplotlib\backends\backend_wxagg.py”,
line 10, in

              from . import backend_wx    # already uses

wxversion.ensureMinimal(‘2.8’)

            File

“c:\python34\lib\site-packages\matplotlib\backends\backend_wx.py”,
line 56, in

              raise ImportError(missingwxversion)

          ImportError: Matplotlib backend_wx and backend_wxagg

require wxversion, which was not found.

https://github.com/matplotlib/matplotlib/pull/3421

I can't seem to create a usable Py3 tool chain.
I tried using pip, presumably getting
wxPython_Phoenix-3.0.2.dev78075-cp34-none-win_amd64.whl
Suggestions?
Results below:

C:\Python34\Scripts>pip install --pre -f
http://wxpython.org/Phoenix/snapshot-builds/ wxPython_Phoenix
Downloading/unpacking wxPython-Phoenix
   http://wxpython.org/Phoenix/snapshot-builds/ uses an insecure
transport scheme (http). Consider using https if wxpytho
n.org has it available
Installing collected packages: wxPython-Phoenix
Successfully installed wxPython-Phoenix
Cleaning up...

>python
Python 3.4.2 (v3.4.2:ab2c023a9432, Oct 6 2014, 22:16:31) [MSC v.1600 64
bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> wx.__version__
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
NameError: name 'wx' is not defined
>>> import wxversion
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
ImportError: No module named 'wxversion'
>>> import wx
C:\Python34\lib\site-packages\wx\core.py:22: UserWarning:
wxPython/wxWidgets release number mismatch
   warnings.warn("wxPython/wxWidgets release number mismatch")
>>> wx.__version__
'3.0.2.dev78075'

- Ray

Further to Werner's answer there's also:-

>>> import wx
C:\Python34\lib\site-packages\wx\core.py:22: UserWarning: wxPython/wxWidgets release number mismatch
   warnings.warn("wxPython/wxWidgets release number mismatch")
>>> wx.version()
'3.0.2.dev78075 msw (phoenix)'

···

On 03/11/2014 02:19, Ray S wrote:

--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

I had to download wxversion.py alone and put it in my site-packages, I also found that it seemed to be buggy for me, and had to modify the source slightly. See here for source link and my modifications:

https://groups.google.com/d/msg/wxpython-dev/X2CTRbZtQCk/m4uxQV_xcj0J

···

On Sunday, November 2, 2014 6:19:27 PM UTC-8, Ray S wrote:

I can’t seem to create a usable Py3 tool chain.
I tried using pip, presumably getting wxPython_Phoenix-3.0.2.dev78075-cp34-none-win_amd64.whl
Suggestions?
Results below:

C:\Python34\Scripts>pip install --pre -f http://wxpython.org/Phoenix/snapshot-builds/ wxPython_Phoenix
Downloading/unpacking wxPython-Phoenix
http://wxpython.org/Phoenix/snapshot-builds/ uses an insecure transport scheme (http). Consider using https if wxpytho
n.org has it available
Installing collected packages: wxPython-Phoenix
Successfully installed wxPython-Phoenix
Cleaning up…

python
Python 3.4.2 (v3.4.2:ab2c023a9432, Oct 6 2014, 22:16:31) [MSC v.1600 64 bit (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.

wx.version
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘wx’ is not defined

import wxversion
Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named ‘wxversion’

All should be aware that wxversion will not be part of phoenix see https://groups.google.com/forum/#!topic/wxpython-dev/RmfriaWPXlQ

···

On 03/11/2014 20:54, Nathan McCorkle wrote:

On Sunday, November 2, 2014 6:19:27 PM UTC-8, Ray S wrote:

    I can't seem to create a usable Py3 tool chain.
    I tried using pip, presumably getting
    wxPython_Phoenix-3.0.2.dev78075-cp34-none-win_amd64.whl
    Suggestions?
    Results below:

    C:\Python34\Scripts>pip install --pre -f
    http://wxpython.org/Phoenix/snapshot-builds/
    <http://wxpython.org/Phoenix/snapshot-builds/> wxPython_Phoenix
    Downloading/unpacking wxPython-Phoenix
    http://wxpython.org/Phoenix/snapshot-builds/
    <http://wxpython.org/Phoenix/snapshot-builds/> uses an insecure
    transport scheme (http). Consider using https if wxpytho
    n.org <http://n.org> has it available
    Installing collected packages: wxPython-Phoenix
    Successfully installed wxPython-Phoenix
    Cleaning up...

     >python
    Python 3.4.2 (v3.4.2:ab2c023a9432, Oct 6 2014, 22:16:31) [MSC
    v.1600 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
     >>> wx.__version__
    Traceback (most recent call last):
       File "<stdin>", line 1, in <module>
    NameError: name 'wx' is not defined
     >>> import wxversion
    Traceback (most recent call last):
       File "<stdin>", line 1, in <module>
    ImportError: No module named 'wxversion'

I had to download wxversion.py alone and put it in my site-packages, I
also found that it seemed to be buggy for me, and had to modify the
source slightly. See here for source link and my modifications:
https://groups.google.com/d/msg/wxpython-dev/X2CTRbZtQCk/m4uxQV_xcj0J

--

--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

I tried copying the wxversion.py from 2.9 into
C:\Python34\Lib\site-packages\wx
and
C:\Python34\Lib\site-packages\wx\lib
at different times; both throw:
software\DCa>C:\Python34\python.exe “software\DCa3\Analysis.py”
C:\Python34\lib\site-packages\wx\core.py:22: UserWarning: wxPython/wxWidgets release number mismatch
warnings.warn(“wxPython/wxWidgets release number mismatch”)
Traceback (most recent call last):
File “C:\Python34\lib\site-packages\matplotlib\backends\backend_wx.py”, line 54, in
import wxversion
ImportError: No module named ‘wxversion’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “software\DCa3\Analysis.py”, line 25, in
import Frame1
File “software\DCa3\Frame1.py”, line 15, in
from PanelEKG import PanelEKG
File “software\DCa3\PanelEKG.py”, line 22, in
import FrameTSAPlots
File “DCa3\FrameTSAPlots.py”, line 27, in
import FrameTSAMethods
File “software\DCa3\FrameTSAMethods.py”, line 32, in
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigCanvas
File “C:\Python34\lib\site-packages\matplotlib\backends\backend_wxagg.py”, line 10, in
from . import backend_wx # already uses wxversion.ensureMinimal(‘2.8’)
File “C:\Python34\lib\site-packages\matplotlib\backends\backend_wx.py”, line 56, in
raise ImportError(missingwxversion)
ImportError: Matplotlib backend_wx and backend_wxagg require wxversion, which was not found.

  • Ray
···

On Monday, 3 November 2014 12:54:04 UTC-8, Nathan McCorkle wrote:

I had to download wxversion.py alone and put it in my site-packages, I also found that it seemed to be buggy for me, and had to modify the source slightly. See here for source link and my modifications:

https://groups.google.com/d/msg/wxpython-dev/X2CTRbZtQCk/m4uxQV_xcj0J

yes, place it in site-packages, it needs to be accessible at the global-level namespace, not inside the wx package. If it was expecting it to be in the wx package, it would have said ‘import wx.wxversion’

···

On Monday, November 3, 2014 3:00:54 PM UTC-8, Ray S wrote:

On Monday, 3 November 2014 12:54:04 UTC-8, Nathan McCorkle wrote:

I had to download wxversion.py alone and put it in my site-packages, I also found that it seemed to be buggy for me, and had to modify the source slightly. See here for source link and my modifications:

https://groups.google.com/d/msg/wxpython-dev/X2CTRbZtQCk/m4uxQV_xcj0J

I tried copying the wxversion.py from 2.9 into
C:\Python34\Lib\site-packages\wx
and
C:\Python34\Lib\site-packages\wx\lib

yup, thanks.

Got a bunch of errors and warns like:
File “C:\Python34\lib\site-packages\matplotlib\backends\backend_wx.py”, line 670, in FigureCanvasWx
wx.WXK_PRIOR : ‘pageup’,
AttributeError: ‘module’ object has no attribute ‘WXK_PRIOR’

so I tweaked those. Also backend_wx.py and backend_wxagg.py, if anyone’s interested.

  • Ray

wxversion.py (17.4 KB)

···

On Monday, 3 November 2014 15:32:17 UTC-8, Nathan McCorkle wrote:

I tried copying the wxversion.py from 2.9 into
C:\Python34\Lib\site-packages\wx
and
C:\Python34\Lib\site-packages\wx\lib

yes, place it in site-packages, it needs to be accessible at the global-level namespace, not inside the wx package. If it was expecting it to be in the wx package, it would have said ‘import wx.wxversion’

...

Got a bunch of errors and warns like:
  File "C:\Python34\lib\site-packages\matplotlib\backends\backend_wx.py", line 670, in FigureCanvasWx
    wx.WXK_PRIOR : 'pageup',
AttributeError: 'module' object has no attribute 'WXK_PRIOR'

so I tweaked those. Also backend_wx.py and backend_wxagg.py, if anyone's interested.

Did you try the PR? https://github.com/matplotlib/matplotlib/pull/3421

It fixes those too and made some changes so mpl 1.4 with it applied works against Py2.7, Py3.x and wxPython classic 2.8+ and Phoenix.

The PR could definitely do with some testing.

Werner

···

On 11/4/2014 4:25, Ray S wrote:

I will!
I use matplotlib as a fallback to mayavi - for the Mac; on Windows mayavi now fails with the 3* tools

  • Ray
···

On Monday, 3 November 2014 20:42:05 UTC-8, werner wrote:

Did you try the PR? https://github.com/matplotlib/matplotlib/pull/3421

It fixes those too and made some changes so mpl 1.4 with it applied
works against Py2.7, Py3.x and wxPython classic 2.8+ and Phoenix.

The PR could definitely do with some testing.

I tried: https://github.com/matplotlib/matplotlib/archive/master.zip
but that doesn’t seem right; it’s 1.4.2 and still wants wxversion…
? Sorry if I’m Git-savvy.

···

On Monday, 3 November 2014 20:42:05 UTC-8, werner wrote:

Did you try the PR? https://github.com/matplotlib/matplotlib/pull/3421

The PR could definitely do with some testing.

BTW, I had used:
pip install -U --pre -f http://wxpython.org/Phoenix/snapshot-builds/ wxPython_Phoenix
to create the original tool chain.

  • Ray
···

On Monday, 3 November 2014 22:00:50 UTC-8, Ray S wrote:

On Monday, 3 November 2014 20:42:05 UTC-8, werner wrote:

Did you try the PR? https://github.com/matplotlib/matplotlib/pull/3421

The PR could definitely do with some testing.

I tried: https://github.com/matplotlib/matplotlib/archive/master.zip
but that doesn’t seem right; it’s 1.4.2 and still wants wxversion…
? Sorry if I’m Git-savvy.

I just re-ran the pip line below; no errors in a few tests so far!
One warning as sort of expected:
C:\Python34\lib\site-packages\wx\core.py:22: UserWarning: wxPython/wxWidgets release number mismatch
warnings.warn(“wxPython/wxWidgets release number mismatch”)

Thanks,

  • Ray
···

On Tuesday, 4 November 2014 09:13:48 UTC-8, Ray S wrote:

BTW, I had used:
pip install -U --pre -f http://wxpython.org/Phoenix/snapshot-builds/ wxPython_Phoenix
to create the original tool chain.

It is ‘just’ a PR and not yet applied to any version.
I am not sure what is the easiest way to get this for you.

  1. clone the repo I used to create the PR
  2. apply a patch to your local copy using a diff/merge tool you use
  3. get the files from the repo I used to create the PR
    Files you need are:
    backend_wx.py
    backend_wxagg.py
    wx_compat.py
    If you find issues or if it just works could you please comment on
    PR - Hope this helps
    Werner
···

Hi,

  On 11/4/2014 7:00, Ray S wrote:
    On Monday, 3 November 2014 20:42:05 UTC-8, werner wrote:
      Did you try the PR? [https://github.com/matplotlib/matplotlib/pull/3421](https://github.com/matplotlib/matplotlib/pull/3421)




      The PR could definitely do with some testing.
      I tried:

but that doesn’t seem right; it’s 1.4.2 and still wants
wxversion…

? Sorry if I’m Git-savvy.

https://github.com/wernerfb/matplotlib/tree/wxPythonPhoenixAug2014

https://github.com/matplotlib/matplotlib/pull/3421.patch

https://github.com/wernerfb/matplotlib/tree/wxPythonPhoenixAug2014

https://github.com/matplotlib/matplotlib/pull/3421

https://github.com/matplotlib/matplotlib/archive/master.zip