I am trying to use wxPython (the version that ships with Fedora 11 - I'm not building it from source). I am seeing:

from wxPython.wx import *
  File "/usr/lib/python2.6/site-packages/wx-2.8-gtk2-unicode/wxPython/__init__.py", line 15, in <module>
    import _wx
  File "/usr/lib/python2.6/site-packages/wx-2.8-gtk2-unicode/wxPython/_wx.py", line 3, in <module>
    from _core import *
  File "/usr/lib/python2.6/site-packages/wx-2.8-gtk2-unicode/wxPython/_core.py", line 15, in <module>
    import wx._core
ImportError: No module named _core

I tried adding:

export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.6/site-packages/wx-2.8-gtk2-unicode/wxPython:/usr/lib/python2.6/site-packages/wx-2.8-gtk2-unicode/wx:/usr/lib/python2.6/site-packages/wx-2.8-gtk2-unicode

to my path in .bashrc, but it didn't change anything.

Any suggestions?

Thanks,

Dave

Edited 6 Years Ago by daviddoria: n/a

_core.py indeed exists there. I just installed wxPython this morning (sudo yum install wxPython*) so I don't think reinstalling would change anything. Any other thoughts?

Thanks,

Dave

This is what I have

>>> from wxPython.wx import *
__main__:1: DeprecationWarning: The wxPython compatibility package is no longer automatically generated or actively maintained.  Please switch to the wx package as soon as possible.
>>> import wx
>>>

I see that deprecation warning, but then it doesn't work.

[doriad@davedesktop gecko]$ python
Python 2.6 (r26:66714, Jul  4 2009, 17:37:22) 
[GCC 4.4.0 20090506 (Red Hat 4.4.0-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from wxPython.wx import *
__main__:1: DeprecationWarning: The wxPython compatibility package is no longer automatically generated or actively maintained.  Please switch to the wx package as soon as possible.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/wx-2.8-gtk2-unicode/wxPython/__init__.py", line 15, in <module>
    import _wx
  File "/usr/lib/python2.6/site-packages/wx-2.8-gtk2-unicode/wxPython/_wx.py", line 3, in <module>
    from _core import *
  File "/usr/lib/python2.6/site-packages/wx-2.8-gtk2-unicode/wxPython/_core.py", line 15, in <module>
    import wx._core
ImportError: No module named _core

However, import wx seems to work fine. Should I just use that instead?

Dave

You can not have wxGTK and wxPython installed at the same time. This bit me a while back. Check to see if wxGTK is installed. Also, check that /usr/bin/python is a symlink to /usr/bin/python2.6 and the same for /usr/lib/python.

If I

sudo yum remove wxGTK

it tries to remove wxPython as well. Is there a way to remove it without removing wxPython?

Thanks,
Dave

A bit of background - I am trying to get an existing script to run. I tried to replace this line:

>>> from wxPython.glcanvas import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/wx-2.8-gtk2-unicode/wxPython/__init__.py", line 15, in <module>
    import _wx
  File "/usr/lib/python2.6/site-packages/wx-2.8-gtk2-unicode/wxPython/_wx.py", line 3, in <module>
    from _core import *
  File "/usr/lib/python2.6/site-packages/wx-2.8-gtk2-unicode/wxPython/_core.py", line 15, in <module>
    import wx._core
ImportError: No module named _core

with this:

>>> from wx.glcanvas import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named glcanvas

and it looks like wx doesn't have a glcanvas.

Is wx not going to be very backwards compatible with wxPython?

Dave

Keying just this into a terminal on my Slackware machine works fine
from wx.glcanvas import *
so it has to be something with the install. Take a look at this link http://www.wxpython.org/download.php I have MESA installed so that may be the difference. You should also try searching the Fedora forum as someone else has probably had this problem.

This article has been dead for over six months. Start a new discussion instead.