Re: wx.version() difference between Python2/3
Robin Dunn <[email protected]>
| Newsgroups | gmane.comp.python.wxpython.devel |
|---|---|
| Message-ID | <[email protected]> |
[email protected] wrote: > On 2015-02-25 23:06 Werner<[email protected]> wrote: >> Sorry, I very very rarely use Linux and can't help on how you figure >> out where your wxPython-Phoenix build has gone and how to make it the >> default. > > Linux is not so point. > > I understood your message that wxPhoenix will never run with Python2 > and it isn't build for Python, too. Am I right, or do I misunderstood > something? > > The mixing of Py2 and Py3 confuses me a lot. > Moonkid, it's not clear to me if you understood what Werner was trying to explain to you, so I thought I would summarize and try to clear things up. When you were seeing wxPython 2.8.12.1 being used when you ran python2 it was not because Phoenix is not compatible, it was because the Classic wx package was being found when Python did the import instead of the Phoenix version. Either you didn't install your Phoenix build, or didn't update PYTHONPATH or sys.path to allow it to search the location where the Phoenix wx package was located, or simply because the Classix wx was found first on the python path. If you ever have doubts about where a package is being imported from you can look at its __file__ attribute to find out. For example: >>> import wx >>> wx.__file__ '/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/__init__.pyc' To help diagnose why an unexpected version of a package is being imported and not the one that you expect, you can examine the sys.path list, and remember that order matters: >>> import sys, pprint >>> pprint.pprint(sys.path) ['', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PIL', '/usr/lib/python2.7/dist-packages/gst-0.10', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client', '/usr/lib/python2.7/dist-packages/ubuntuone-client', '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel', '/usr/lib/python2.7/dist-packages/ubuntuone-couch', '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol', '/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode'] -- Robin Dunn Software Craftsman http://wxPython.org -- You received this message because you are subscribed to the Google Groups "wxPython-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.