wxPython and Linux dependencies

Discussion in 'Python' started by diffuser78@gmail.com, Jul 6, 2006.

  1. Guest

    Hi,

    I wrote a small app using wxPython on a Linux distro called Ubuntu (it
    is a debain derivative). I ran it on windows and it just worked
    perfectly. Now, when I am trying to install the same app on a different
    Linux Distro (Red Hat Linux) I cannot get it to work. This Red Hat
    variant is a customized version of Red Hat of a Company where I work.
    It uses python 2.3.4.
    I installed wxPython and other dependencies mentioned on
    http://www.wxpython.org/download.php

    Can somebody give me some pointers to get it working .?

    Every help is appreciated.
     
    , Jul 6, 2006
    #1
    1. Advertising

  2. "cannot get it to work." is pretty broad, you are more likely to get
    help if you post an error message or any other details.

    wrote:
    > Hi,
    >
    > I wrote a small app using wxPython on a Linux distro called Ubuntu (it
    > is a debain derivative). I ran it on windows and it just worked
    > perfectly. Now, when I am trying to install the same app on a different
    > Linux Distro (Red Hat Linux) I cannot get it to work. This Red Hat
    > variant is a customized version of Red Hat of a Company where I work.
    > It uses python 2.3.4.
    > I installed wxPython and other dependencies mentioned on
    > http://www.wxpython.org/download.php
    >
    > Can somebody give me some pointers to get it working .?
    >
    > Every help is appreciated.
     
    Nick Vatamaniuc, Jul 6, 2006
    #2
    1. Advertising

  3. Guest

    Error message "cannot find wx"

    infact I have wxpython in /usr/lib/

    I installed it using the rpms given on the wxPython website. Do I need
    to set some path or something.

    Nick Vatamaniuc wrote:
    > "cannot get it to work." is pretty broad, you are more likely to get
    > help if you post an error message or any other details.
    >
    > wrote:
    > > Hi,
    > >
    > > I wrote a small app using wxPython on a Linux distro called Ubuntu (it
    > > is a debain derivative). I ran it on windows and it just worked
    > > perfectly. Now, when I am trying to install the same app on a different
    > > Linux Distro (Red Hat Linux) I cannot get it to work. This Red Hat
    > > variant is a customized version of Red Hat of a Company where I work.
    > > It uses python 2.3.4.
    > > I installed wxPython and other dependencies mentioned on
    > > http://www.wxpython.org/download.php
    > >
    > > Can somebody give me some pointers to get it working .?
    > >
    > > Every help is appreciated.
     
    , Jul 6, 2006
    #3
  4. John Salerno Guest

    wrote:
    > Error message "cannot find wx"
    >
    > infact I have wxpython in /usr/lib/
    >
    > I installed it using the rpms given on the wxPython website. Do I need
    > to set some path or something.


    Could it be that it is trying to use another, pre-installed version of
    Python -- one which doesn't have wxPython installed with it?
     
    John Salerno, Jul 6, 2006
    #4
  5. Guest

    How can we find that it is not using the right version of Python ?

    John Salerno wrote:
    > wrote:
    > > Error message "cannot find wx"
    > >
    > > infact I have wxpython in /usr/lib/
    > >
    > > I installed it using the rpms given on the wxPython website. Do I need
    > > to set some path or something.

    >
    > Could it be that it is trying to use another, pre-installed version of
    > Python -- one which doesn't have wxPython installed with it?
     
    , Jul 6, 2006
    #5
  6. John,
    To see where Python is looking for libraries open an interactive Python
    prompt and type
    >>> import sys
    >>> print sys.path

    You will get a list of paths where Python will look for modules. Also
    check to see if you have the PYTHONPATH environment variable set. If
    /usr/lib is not in the path list then Python won't be able to import wx
    from there. To test your wx app, you can append to sys.path the path of
    your wx module then try to import again.

    Hope this helps,
    Nick V.



    wrote:
    > How can we find that it is not using the right version of Python ?
    >
    > John Salerno wrote:
    > > wrote:
    > > > Error message "cannot find wx"
    > > >
    > > > infact I have wxpython in /usr/lib/
    > > >
    > > > I installed it using the rpms given on the wxPython website. Do I need
    > > > to set some path or something.

    > >
    > > Could it be that it is trying to use another, pre-installed version of
    > > Python -- one which doesn't have wxPython installed with it?
     
    Nick Vatamaniuc, Jul 6, 2006
    #6
  7. <> wrote in message
    news:...
    > Error message "cannot find wx"
    >
    > infact I have wxpython in /usr/lib/
    >
    > I installed it using the rpms given on the wxPython website. Do I

    need
    > to set some path or something.


    I vaguely remember that wxWindows changed name to wxWidgets and
    wxPython changed convention along the way so that one should do:

    "include wx" and reference wx stuff as wx<dot><something> ....

    instead of "the old way" of:

    "from wxPython include *" and reference as f.ex. wxDialog:

    This is from memory, I cannot remember what version of wxPython the
    change happened - but I was bitten by it.

    Check the versions of wxPython on RedHat and Ubuntu - Ubuntu will
    almost certainly be newer than RedHat!
     
    Frithiof Andreas Jensen, Jul 7, 2006
    #7
  8. John Salerno Guest

    Nick Vatamaniuc wrote:

    > To see where Python is looking for libraries open an interactive Python
    > prompt and type
    >>>> import sys
    >>>> print sys.path


    After doing this you will see something like

    'C:\\Python24\\lib\\site-packages\\wx-2.6-msw-ansi' (from my system)

    in the list, otherwise it isn't finding wxPython. Also, probably just
    looking at the version of Python you are using when the interactive
    prompt starts up might give you a clue. If it's different than the
    version you installed wxPython in, then that's why it isn't finding it.
    (But I don't know if the version that the interactive prompt uses is
    necessarily the version that will be used to run your program, assuming
    you have multiple versions installed, so maybe these methods won't be
    perfectly accurate. Not sure how it gets decided which version to use if
    you have more than one, especially on Unix systems.)
     
    John Salerno, Jul 7, 2006
    #8
  9. Guest

    Let me explain and give you some more details.

    When I type "python" at the command prompt it shows the following info.
    python 2.3.4 (#Feb 01 2005), GCC 3.4.3 20041212 Red Hat 3.4.3-9.EL4 on
    linux2


    In /usr/lib/ there are two directories called python 2.3 and python 2.4

    In /usr/lib/python2.3/site-packages I could NOT find anything related
    to wx and in particular

    wx-2.6-gtk2-unicode
    wx.pth
    wxversion.py
    wxversion.pyc


    In /usr/lib/python2.4/ there is only one folder called site-packages
    and NO other files.

    So /usr/lib/python2.4/site-packages/ has only one folder called
    "wx-2.6-gtk2-unicode" and a file called " wx.pth" and another file
    wx.version.py (and its compiler version wx.version.pyc). wx.pth
    contains wx-2.6-gtk2-unicode

    So, what my feeling is that I have python 2.3 and wx package is for
    2.4. So my installed variant cannot find the wx package.

    What is the easiest way from this point on to get my small wxPython app
    running ???

    Every help is appreciated.



    Nick Vatamaniuc wrote:
    > John,
    > To see where Python is looking for libraries open an interactive Python
    > prompt and type
    > >>> import sys
    > >>> print sys.path

    > You will get a list of paths where Python will look for modules. Also
    > check to see if you have the PYTHONPATH environment variable set. If
    > /usr/lib is not in the path list then Python won't be able to import wx
    > from there. To test your wx app, you can append to sys.path the path of
    > your wx module then try to import again.
    >
    > Hope this helps,
    > Nick V.
    >
    >
    >
    > wrote:
    > > How can we find that it is not using the right version of Python ?
    > >
    > > John Salerno wrote:
    > > > wrote:
    > > > > Error message "cannot find wx"
    > > > >
    > > > > infact I have wxpython in /usr/lib/
    > > > >
    > > > > I installed it using the rpms given on the wxPython website. Do I need
    > > > > to set some path or something.
    > > >
    > > > Could it be that it is trying to use another, pre-installed version of
    > > > Python -- one which doesn't have wxPython installed with it?
     
    , Jul 7, 2006
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anand
    Replies:
    1
    Views:
    372
    Cliff Wells
    Jul 23, 2003
  2. ulysses
    Replies:
    4
    Views:
    820
    Werner Schiendl
    Oct 22, 2003
  3. Logan
    Replies:
    5
    Views:
    792
    David Bolen
    Dec 11, 2003
  4. Replies:
    0
    Views:
    274
  5. Replies:
    0
    Views:
    418
Loading...

Share This Page