wx.version() difference between Python2/3

I build in the last three hours wxPhoenix with Python2 and 3.

Is it correct that the version-string differs between this two Pythons?

Python 3.4.0 (default, Apr 11 2014, 13:05:18)
[GCC 4.8.2] on linux

import wx
wx.version()

'3.0.3.dev1684+6933551 gtk2 (phoenix)'

Python 2.7.6 (default, Mar 22 2014, 22:59:38)
[GCC 4.8.2] on linux2

import wx
wx.version()

'2.8.12.1 (gtk2-unicode)'

With Py2.7 you must have build the classic instead of wxPython-Phoenix, or the default wx version found is classic.

On Windows the default is defined in the file wx.pth under site-packages, sorry don't know how that is done in Linux.

Werner

···

On 2/25/2015 11:24, moonkid@posteo.org wrote:

I build in the last three hours wxPhoenix with Python2 and 3.

Is it correct that the version-string differs between this two Pythons?

Python 3.4.0 (default, Apr 11 2014, 13:05:18)
[GCC 4.8.2] on linux

import wx
wx.version()

'3.0.3.dev1684+6933551 gtk2 (phoenix)'

Python 2.7.6 (default, Mar 22 2014, 22:59:38)
[GCC 4.8.2] on linux2

import wx
wx.version()

'2.8.12.1 (gtk2-unicode)'

Puh... Now I am complete confused.

Isn't it one of wxPhoenix feauters that it runs with Python2 & 3 ?

"the classic" means the official stable wxPyhton release? I don't need
to build that it is in my ubuntu package repository (a little bit
outdatet but ok).

So you try to tell me that wxPhoenix isn't buildable (is this a word?)
with Python2. The "pip install -U --pre -f http://wx…" wouldn't never
work with Python2?

I thought all of you working with Python2. You are using
"pip" not "pip3" (as I do). The doc-build commands someone gave me are
with python2.7, etc.
The build.py itself doesn't run the doc build ("wxlib sphinx") with
python3 so I have to fix a lot of Pyhton3-related-errors and currently
preparing a patch/PR for it.

I don't want wxPhoenix for Python2. But I needed to test my fixed
build.py with Python2 before a PullRequest. That is why I tried to
build wxPhoenix with the normal "pip" (what for me implicate Python2)
so I can run the doc-build thing with Python2, too.
Maybe my Python3-related modifications on build.py (and child-scripts)
are crah on Python2.

Do you work with and develop on wxPhoenix with Python3 but build the
docs for it with Python2? The build.py doesn't run with Python3.

So please explain me the version-thing and stop me crying. :wink:

btw: All that only because I want to improve the doc itself. Currently
I want to set the return-type of Point.Get() and Size.Get(). Nothing
more! :smiley:

···

On 2015-02-25 11:31 Werner <wernerfbd@gmx.ch> wrote:

With Py2.7 you must have build the classic instead of
wxPython-Phoenix, or the default wx version found is classic.

With Py2.7 you must have build the classic instead of
wxPython-Phoenix, or the default wx version found is classic.

Puh... Now I am complete confused.

Or you built wxPython-Phoenix based on what you say below, but it is not found when you do 'import wx' but the one found is the one installed by default.

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.

Werner

···

On 2/25/2015 21:51, moonkid@posteo.org wrote:

On 2015-02-25 11:31 Werner <wernerfbd@gmx.ch> wrote:

Isn't it one of wxPhoenix feauters that it runs with Python2 & 3 ?

"the classic" means the official stable wxPyhton release? I don't need
to build that it is in my ubuntu package repository (a little bit
outdatet but ok).

So you try to tell me that wxPhoenix isn't buildable (is this a word?)
with Python2. The "pip install -U --pre -f http://wx…" wouldn't never
work with Python2?

I thought all of you working with Python2. You are using
"pip" not "pip3" (as I do). The doc-build commands someone gave me are
with python2.7, etc.
The build.py itself doesn't run the doc build ("wxlib sphinx") with
python3 so I have to fix a lot of Pyhton3-related-errors and currently
preparing a patch/PR for it.

I don't want wxPhoenix for Python2. But I needed to test my fixed
build.py with Python2 before a PullRequest. That is why I tried to
build wxPhoenix with the normal "pip" (what for me implicate Python2)
so I can run the doc-build thing with Python2, too.
Maybe my Python3-related modifications on build.py (and child-scripts)
are crah on Python2.

Do you work with and develop on wxPhoenix with Python3 but build the
docs for it with Python2? The build.py doesn't run with Python3.

So please explain me the version-thing and stop me crying. :wink:

btw: All that only because I want to improve the doc itself. Currently
I want to set the return-type of Point.Get() and Size.Get(). Nothing
more! :smiley:

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.

···

On 2015-02-25 23:06 Werner <wernerfbd@gmx.ch> 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.

As you can see there should be no diff between the version strings.
And it is possible to build wxPhoenix for Python2.

user@MONSTER:~$ python -c "import wx;print(wx.version())"
3.0.3.dev1687+e308d98 gtk2 (phoenix)
user@MONSTER:~$ python3 -c "import wx;print(wx.version())"
3.0.3.dev1684+6933551 gtk2 (phoenix)

But I am not sure how this succuessfull build differs from the other
unsucessfull before. :wink:

I think some system components are involved: python-config
(ubuntu-package: python-dev)

The scripts in the snapshot and in the sources (build.py, etc) should
check the presents of all needed system-components before doing
something. If they are not there: give a human readable message about
it.

Hi,

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?

No that it not so, Phoenix runs with Py2.7 and Py3.3+ on all three platforms.

I currently have it installed on Windows on Py2.7 and Py3.4 and the same on LinuxMint 17.

As I dev mainly on Windows I have in the Py2.7 install multiple wxPython installs, they include 2.8.12, 2.9.5, 3.0.2 classic and a pretty current version of Phoenix.

On LinuxMint I don't have other wxPython versions installed, so when importing wx I always get the installed wxPython-Phoenix version.

On Windows I do switch between the different wxPython versions using the 'wx.pth' file in lib/site-packages. But that only works with some manual adjustments after I install a new version of wxPython-Phoenix, i.e. I move the 'wx' folder and the 'wxPython-Phoenixsomething.info' folder to a folder I called 'wx-3.0.3-msw-phoenix' to follow the folder naming convention wxversion (see MultiVersionInstalls - wxPyWiki).

Werner

···

On 2/26/2015 0:07, moonkid@posteo.org wrote:

On 2015-02-25 23:06 Werner <wernerfbd@gmx.ch> wrote:

moonkid@posteo.org 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']

···

On 2015-02-25 23:06 Werner<wernerfbd@gmx.ch> wrote:

--
Robin Dunn
Software Craftsman