wxGTK and wxGTK3 incompatible?

I'm starting a new, large-scale project using python-2.7.5. I've installed
wxPython-3.0.0.0 with wxGTK-2.8.12. I also have python3-3.4.0 installed with
wxGTK-3.0.1

   After a lot of ineffective Web searching and trial-and-error exploring
here I discovered that with wxGTK-2.8.12 installed a one-panel .py file will
display because it's called using python-2.7.5, but if wxGTK-3.0.1 is also
installed wxPython becomes confused and throws an error.

   Is there a way to have wxGTK2 and wxGTK3 co-exist without the latter being
invoked when an application is run with 'python' rather than 'python3'?

Thanks,

Rich

^
   Should be wxGTK3-3.0.1

Mea culpa!

Rich

···

On Wed, 2 Jul 2014, Rich Shepard wrote:

wxGTK-3.0.1

Not so much a fix as a workaround would be to use you can use it to select a given installation of wx as run time,
e.g.:

···

On 03/07/14 01:44, Rich Shepard wrote:

  On Wed, 2 Jul 2014, Rich Shepard wrote:
    wxGTK-3.0.1
  ^


    Should be wxGTK3-3.0.1




  Mea culpa!




  Rich

wx.Version

    import wxversion
import sys
if sys.version_info.major < 3:
wxversion.select(['2.5.4', '2.5.5', '2.6'])
else:
 wxversion.
[ensureMinimal](http://www.wxpython.org/docs/api/wxversion-module.html#ensureMinimal)

('3.0')
import wx
Hope that is a help. I would also suggest looking into pythons [virtualenv](https://pypi.python.org/pypi/virtualenv) for testing.
Gadget/Steve

</details>

Gadget/Steve,

   Looks like a solution to me. I'll read up on both. I suppose the ideal
solution would be to select the appropriate wxPython version based on the
python version specified at the top of the script, but either of the above
will certainly be a functional resolution.

Much appreciated,

Rich

···

On Thu, 3 Jul 2014, Steve Barnes wrote:

Not so much a fix as a workaround would be to use wx.Version
<wxPython API Documentation — wxPython Phoenix 4.2.2 documentation; you can use it to
select a given installation of wx as run time, e.g.:

Hope that is a help. I would also suggest looking into pythonsvirtualenv <https://pypi.python.org/pypi/virtualenv&gt; for testing.

This LINK is for older versions of Python but I was able to do something similar within a Python 2.7.5 interpreter.

What I did:

import sys

print float(2.7) >= float(‘%i.%i’%(sys.version_info[0], sys.version_info[1]))

This resulted with the expected ‘True’ being printed. This may help with selecting the appropriate wxPython version based on what version of Python is being used to run the script.

···

On Wednesday, July 2, 2014 8:39:58 PM UTC-4, fuzzydoc wrote:

I’m starting a new, large-scale project using python-2.7.5. I’ve installed

wxPython-3.0.0.0 with wxGTK-2.8.12. I also have python3-3.4.0 installed with

wxGTK-3.0.1

After a lot of ineffective Web searching and trial-and-error exploring

here I discovered that with wxGTK-2.8.12 installed a one-panel .py file will

display because it’s called using python-2.7.5, but if wxGTK-3.0.1 is also

installed wxPython becomes confused and throws an error.

Is there a way to have wxGTK2 and wxGTK3 co-exist without the latter being

invoked when an application is run with ‘python’ rather than ‘python3’?

Thanks,

Rich

Thanks, Mike. My current work is with python-2.7.5, but I want to keep
current with the python3 tools for future use. And I now know how to have
gtk2 and gtk3 present without confusing wxPython-3.0.0.0.

Regards,

Rich

···

On Thu, 3 Jul 2014, Mike Stover wrote:

This LINK
<Checking Version of Python Interpreter Upon Execution of Script With Invalid Syntax - Stack Overflow; is
for older versions of Python but I was able to do something similar within
a Python 2.7.5 interpreter.

What I did:
   import sys
   print float(2.7) >= float('%i.%i'%(sys.version_info[0],
sys.version_info[1]))

This resulted with the expected 'True' being printed. This may help with
selecting the appropriate wxPython version based on what version of Python
is being used to run the script.

Steve,

   I have only one version of wxPython installed: -3.0.0.0.

   Yesterday, I removed wxPython, wxGTK, and wxGTK3. Rebuilt and installed
wxGTK-2.8.12, then wxPython-3.0.0.0. Running my test script invoked the
application.

   Building and installing wxGTK3-3.0.1 caused that same script to fail.
Removing wxGTK3-3.0.1 allowed the test application to work.

   So, for some reason, the one version of wxPython that's installed (no
Phoenix here) cannot select the appropriate version of wxGTK. Reading the
wxversion module page shows me it works on multiple wxPython versions, not
multiple wxGTK versions, even when the latter have different names (wxGTK
and wxGTK3).

   Perhaps someone familiar with wxPython internals can suggest a solution.

Thanks,

Rich

···

On Thu, 3 Jul 2014, Steve Barnes wrote:

Not so much a fix as a workaround would be to use wx.Version <wxPython API Documentation — wxPython Phoenix 4.2.2 documentation; you can use it to select a given installation of wx as run time, e.g.:

Got it resolved.

   A few months ago, a wxPython application would not run until I installed
wxGTK. Therefore, I assumed that both were needed.

   Just now I removed wxGTK and my test application worked just fine with
only wxPython-3.0.0.0 installed. So, I will leave both wxGTK and wxGTK3 off
the system.

Rich

···

On Thu, 3 Jul 2014, Rich Shepard wrote:

Perhaps someone familiar with wxPython internals can suggest a solution.

Congratulations Rich - strides forward.

Steve

···

On 03/07/14 15:43, Rich Shepard wrote:

On Thu, 3 Jul 2014, Rich Shepard wrote:

Perhaps someone familiar with wxPython internals can suggest a solution.

  Got it resolved.

  A few months ago, a wxPython application would not run until I installed
wxGTK. Therefore, I assumed that both were needed.

  Just now I removed wxGTK and my test application worked just fine with
only wxPython-3.0.0.0 installed. So, I will leave both wxGTK and wxGTK3 off
the system.

Rich