How to use wxPython for Python 3?
Question: I installed `wxPython 3.0.1.1`, but I'm unable to `import wx` using `Python
3.4.1`. I am getting the following error:

    
    
    Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 00:54:21) 
    [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import wx
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ImportError: No module named 'wx'
    

Nevertheless, I can `import wx` if I use `Python 2.7` (the default
installation in my `OS X 10.9`):

    
    
    Python 2.7.5 (default, Mar  9 2014, 22:15:05) 
    [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import wx
    >>>
    

How can I use wxPython for Python 3, and specifically for Python 3.4.1?


Answer: You have two different pythons installed on your machine (3.4.1 and 2.7.5). Do
not expect to be able to use one package installed in one python (wxPython
3.0.1.1 at python 2.7.5) automatically to be available in another python.

Additionally wxPython (classic) does not work for Python 3. You need
[_wxPython Phoenix_](http://wxpython.org/Phoenix/docs/html/index.html) to be
able to do that.

You can try to install one of [the wxPython Phoenix
snapshots](http://wxpython.org/Phoenix/snapshot-builds/) in your Python 3.4.1.
However, because Phoenix is not equally mature as classic, do not expect
everything to work out of the box.

You can find a complete explanation/description in the following wxPython wiki
at the following link:

> [Installing wxPython-Phoenix using
> pip](http://wiki.wxpython.org/How%20to%20install%20wxPython#Installing_wxPython-
> Phoenix_using_pip)

There are several important points:

  * that `pip`/`setuptool` is new enough (> 6.x.x/> 12.x.x)

  * that the builds are "inofficial", and thus `pip` refuses to install it: basically you need to add `--pre` when installing with pip.

  * that you waive SSL verification `--trusted-host wxpython.org`

Full command for Windows machines:

    
    
    C:\python27\scripts\pip.exe install --upgrade --trusted-host wxpython.org --pre -f http://wxpython.org/Phoenix/snapshot-builds/ wxPython_Phoenix
    

Note that this will install wxPython Phoenix for Python 2.7.

