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'?
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>
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.
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, 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.
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.
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.
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.
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.