Can't Run wxPython

I installed from the RPM without changing any of the default settings. It
seems to have installed successfully. (At least, if I try to install
again, it tells me the package has already been installed.)

Thanks again!

Original Message:

···

-----------------
From: Ricardo Pedroso ricardo.pedroso@netvisao.pt
Date: Tue, 13 Sep 2005 12:49:53 +0100
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] Can't Run wxPython

On Tue, 2005-09-13 at 07:24 -0400, Shari Rolnick wrote:

I am trying to get wxPython to run on my Fedora Core 4 installation.
I'm running version 2.4.1 of Python. However, I can't get the system to
recognize the main module. Here is the error that I am getting:

[shari@localhost thesis]$ python wxPythonExample.py
Traceback (most recent call last):
  File "wxPythonExample.py", line 17, in ?
    import wx
ImportError: No module named wx

Here is where I set my PYTHONPATH variable:

PYTHONPATH=/usr/lib/python2.4/site-packages:$HOME/VTK/VTK/bin:
$HOME/VTK/VTK/Wrapping/Python:
export PYTHONPATH

You need to provide more info about your installation steps.
Did you install from sources?
If so what parameters did you give to configure?
....

I think if you install from the fedora2 rpms, it will work.

Ricardo

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .

shari@loralee.net wrote:

I installed from the RPM without changing any of the default settings. It
seems to have installed successfully. (At least, if I try to install
again, it tells me the package has already been installed.)

Which rpm? Last I looked there was not one for Fedora Core4. However, that doesn't mean you can't get it working with the old rpm.

IIRC, the problem is that the rpm puts everything in /usr/local/lib, while FC4 has python2.4 in /usr/lib. Your PYTHONPATH confirms that you have python installed in /usr/lib

Check what the rpm is doing by:

rpm -qlp name_of_rpm.rpm

If it's putting everything in /usr/local/lib, then you can do a rpm --relocate, and have it put in /usr/lib. However, the rpm has hard coded the location of the wxlibs, so then you'll need to put in a symlink form the real libs in /usr/lib to where wx things they should be, in /usr/local/lib.

Another, better, option is to just build the src rpm yourself. See the man page for rpmbuild to see how, I think it's as simple as:

rpmbuild --rebuild wxPython2.6-2.6.1.0-1.src.rpm

Look at the output to see where the resulting rpms are put.

A third, even easier option, is to send me a note, and I can send you the rpms I built on my FC4 system.

If anyone is reading this that could add files to sourceforge, I'd be glad to give you my FC4 rpms to put there for download. I don't' have anywhere to host them myself.

I really should put all this in the Wiki page. In fact, if the OP gets things working as a result of this advice, please pay back the community by writing this up in a Wiki page.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov