LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 07-09-2006, 06:33 PM   #1
jdwilder
Member
 
Registered: Jul 2003
Location: United States
Distribution: Fedora Core 7 and older, Knoppix, Ubuntu
Posts: 121

Rep: Reputation: 15
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.
 
Old 07-10-2006, 09:53 PM   #2
Sledge
Member
 
Registered: Nov 2003
Distribution: Fedora Core 6
Posts: 76

Rep: Reputation: 15
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.
 
Old 07-10-2006, 10:20 PM   #3
jdwilder
Member
 
Registered: Jul 2003
Location: United States
Distribution: Fedora Core 7 and older, Knoppix, Ubuntu
Posts: 121

Original Poster
Rep: Reputation: 15
[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.
 
Old 07-10-2006, 10:43 PM   #4
Sledge
Member
 
Registered: Nov 2003
Distribution: Fedora Core 6
Posts: 76

Rep: Reputation: 15
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

Last edited by Sledge; 07-10-2006 at 10:46 PM.
 
Old 07-10-2006, 10:49 PM   #5
jdwilder
Member
 
Registered: Jul 2003
Location: United States
Distribution: Fedora Core 7 and older, Knoppix, Ubuntu
Posts: 121

Original Poster
Rep: Reputation: 15
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.
 
Old 07-10-2006, 10:57 PM   #6
Sledge
Member
 
Registered: Nov 2003
Distribution: Fedora Core 6
Posts: 76

Rep: Reputation: 15
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.

Last edited by Sledge; 07-10-2006 at 11:09 PM.
 
Old 07-11-2006, 06:17 AM   #7
jdwilder
Member
 
Registered: Jul 2003
Location: United States
Distribution: Fedora Core 7 and older, Knoppix, Ubuntu
Posts: 121

Original Poster
Rep: Reputation: 15
okay, I will try it
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
python problem - compiled from source - python -V still showing old version txm123 Linux - Newbie 1 02-15-2006 12:05 PM
python, import and execfile() cs-cam Programming 1 10-18-2005 09:47 PM
Python: Idle: ImportError: cannot import name sleep Joe Soap Linux - Newbie 1 10-01-2005 02:52 AM
python: import distutils fails on debian? jpbarto Linux - Software 0 01-18-2004 11:36 AM
Python - can I import my own stuff? miknight Programming 1 06-10-2003 08:48 AM


All times are GMT -5. The time now is 11:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration