Question

Does wxPython have a version for Python 3?

If it does, where can I get it?

Was it helpful?

Solution

Updated news on this question are being posted in the wxpython wiki. Here you can find everal edits updating the initial answer (first more recent)

December 2011: Great news ! First build of project Phoenix the new wxPython that will support both Python 2.x and 3.x. Current builds are however for python 2.7.

November 2011: Last Update of the wiki is from 19-April-2011. == No news for 3.x :-(

Tentative wxPython Roadmap

  • wxPython "Next Generation": (ongoing) There has been some discussions off and on over the past couple years about a whole new way to generate the code used for the wxPython extension modules (a.k.a the C++ wrapper code). There has been some design work done towards this goal, and a proof of concept has been implemented. In a nutshell the proof of concept has exceeded all my expectations and I feel that this will be an excellent way to automate much more of the generation of the wrapper code. More information about the goals and design of the new wxPython can be found at ProjectPhoenix, and the source code can be viewed in the wx repository. Although the new approach will make maintenance of wxPython much simpler in the future, it is still a lot of work to make the transition and so it will not become the highest priority task until more of the low-level foundational pieces are completed and verified. In the meantime the current 2.9.x ReleaseSeries will continue to progress using the old technology. #

  • Python 3.x support: (unknown) It is expected that some things being done for the Next Generation project will make it easier to be able to maintain support for both Python 2.x and 3.x in the same source tree, so I've been delaying putting much effort into a Python 3.x port in order to prevent wasting time on something that may end up getting thrown away once the NG switch is made. If that Next Generation project ends up being left on-hold for too long however then I'll probably revisit this item and move up the priority.

At this moment (Nov 2011) wxPython is, after Django, the most desired package for Python 3-coders:

Here are the 15 most often nominated packages where users desire Python 3 support

Package Number of Votes
Django 1970
wxPython 941
matplotlib 875
..................
..................

Jun 2010: There is not schedule for wxpython in py3k

Tentative wxPython Roadmap

  • wxPython "Next Generation": (future) There has been some discussions off and on over the past couple years about a whole new way to generate the code used for the wxPython extension modules (a.k.a the C++ wrapper code). There has been some design work done towards this goal, and the beginnings of some work on tools. However since work was progressing slowly on this I decided to put it on hold for a bit so I could get some of the new features and fixes in the 2.9 release series into the hands of the wxPython developers. I expect to be able to switch my focus back to this goal sometime after the 2.9.1 release. Once the design, plans and tools are complete enough I'll publish more information about it and open it up for other developers to lend a hand.
  • Python 2.7 support: (now) The Windows and OSX build machines have been updated with Python 2.7 and binaries for 2.7 were included with 2.8.11.0 and will be included in future preview builds and releases.
  • Python 3.x support: (unknown) I'm hopeful that some things being done for the Next Generation project will make it easier to be able to maintain support for both Python 2.x and 3.x in the same source tree, so I've been delaying putting much effort into a Python 3.x port in order to prevent wasting time on something that may end up getting thrown away once the NG switch is made. If that Next Generation project ends up being left on-hold for too long however then I'll probably revisit this item and move up the priority.

OTHER TIPS

From the newsgroups:

Note that PyQt now supports Python 3, so perhaps that's an option worth considering.

No. For now latest version of Python it supports is 2.6.

In the Py3K there are changes in the C API, so you'll have to be patient. It'll take some time, before all the libraries get ported.

No binary installers yet, but regular snapshot builds which are easy to install.

http://wxpython.org/Phoenix/snapshot-builds/

I run it on Windows and just create a folder in site-packages e.g. "\site-packages\wx-2.9.6-msw" and copy the "wx" folder from the snapshot-build into it and then I use wxversion to work with it.

import wxversion
import twcbsrc.configdev as cfd
wxversion.select('2.9.6')

Confirmed wxpython works with python3.3. System spec: Windows 8.1 64bit. Python was a first time install on this new machine (so no previous versions exist). Objective: get matplotlib to work with their wx examples.

Setup Notes:

  1. Grab the wxpython from the snapshot library listed in Werners post above (eg wxpython for py3.3, 64 bit). wxversion was not included, so obtained it from mit. Also place it in site-packages.

  2. convert the content in wxversion to be compatible with py 3.3. ie replace has_key with in and the try except constructs to use as instead of ",". When you run the code within eclipse or similar the interpreter will tell you what it doesn't like.

  3. For the matplotlib setup I didnt need to add wxversion.select() into the example code, but matplotlib did need that module. Trying a select() call would fail for any version I chose (even with a long range of possible version X.X numbers).

wxPython 4 was released 2018-01-31 and is now pip installable. It supports Python 2.7 and Python 3.4+. You can find it on PyPI here:

If you are migrating from wxPython 2.8 or 3.0 to wxPython 4, you will want to see the following articles:

Old versions of wxPython are still on SourceForge

This command c:\Python34\Scripts\pip install -U --pre -f http://wxPython.org/Phoenix/snapshot-builds/ wxPython_Phoenix should get you the latest version of Phoenix on any OS as the Python wheel file formats are now supported.

If you are facing problem to install wxpython on Python3 please use this command to install wxpython

$ pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-16.04 wxPython

By this command you can install latest wxPython4 version. If you are using Windows or macOS

$ pip install -U wxpython

If you want to use Anaconda venv use this

$conda intall -c anaconda wxpython
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top