LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Python 'import wx' problem (https://www.linuxquestions.org/questions/programming-9/python-import-wx-problem-462413/)

jdwilder 07-09-2006 05:33 PM

Python 'import wx' problem
 
I am a newbie to python (just started yesterday) and for some reason I cannot import wx to start creating GUIs.

I am using Fedora 5 and installed wxPython via yum, so I thought it should have gone to the correct location.

When I try to import wx I get
Quote:

Traceback (most recent call last):
File "jodit.py", line 1, in ?
import wx
File "/usr/lib/python2.4/site-packages/wx/__init__.py", line 45, in ?
from wxPython import wx
File "/usr/lib/python2.4/site-packages/wxPython/__init__.py", line 20, in ?
import wxc
ImportError: /usr/lib/libwx_gtk2-2.4.so.0: undefined symbol: pango_x_get_context
This is included in the sys.path
'/usr/lib/python2.4/site-packages/wx-2.6-gtk2-unicode'
and I also tried adding
/usr/lib/python2.4/wx
/usr/lib/python2.4/wxPython
to the path but that didn't help.
What is wxc and why does it not find it? If I try to import wxc it says it doesn't exist.

Sledge 07-10-2006 08:53 PM

What happens if you just type import wx form the prompt instead of importing it in a sript? I have wx installed and don't see any reference to wxc.

jdwilder 07-10-2006 09:20 PM

[code]
>>> import wx
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.4/site-packages/wx/__init__.py", line 45, in ?
from wxPython import wx
File "/usr/lib/python2.4/site-packages/wxPython/__init__.py", line 20, in ?
import wxc
ImportError: /usr/lib/libwx_gtk2-2.4.so.0: undefined symbol: pango_x_get_context>>>
[code]

It does the same thing.

I have looked in several files and tried to take the c of the wx and it didn't help, it just caused other problems.
I don't know what wxc is, if I try to import it the interpreter doesn't know what it is either.

Sledge 07-10-2006 09:43 PM

What rpm's did you use to install python and wx?

The only wx reference I have under site packages is

/usr/lib/python2.4/site-packages/wx-2.6-gtk2-ansi

jdwilder 07-10-2006 09:49 PM

Python was installed when I installed the system and I installed wxPython from Fedoras package manager yum by doing "yum install wxPython"
I had assumed this would make everything go where it is supposed to.
I thought about uninstalling Python and reinstalling it but there are so many dependencies that a lot of my other programs will get deleted with it, and I already removed wxPython and reinstalled it.

Sledge 07-10-2006 09:57 PM

In this particular case I didn't use wxPython from the Fedora repos. You might try installing the rpms from:

http://wxpython.org/download.php

These are the two I used (you can use unicode instead of ansi):
wxPython2.6-gtk2-ansi-2.6.3.0-fc4_py2.4
wxPython-common-gtk2-ansi-2.6.3.0-fc4_py2.4

I know that doesn't actually explain what is up with the wxPython you installed, but at least it should get you working.

jdwilder 07-11-2006 05:17 AM

okay, I will try it


All times are GMT -5. The time now is 09:17 PM.