wxPython and Linux dependencies

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • diffuser78@gmail.com

    wxPython and Linux dependencies

    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


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

    Every help is appreciated.

  • Nick Vatamaniuc

    #2
    Re: wxPython and Linux dependencies

    "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.

    diffuser78@gmai l.com 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

    >
    Can somebody give me some pointers to get it working .?
    >
    Every help is appreciated.

    Comment

    • diffuser78@gmail.com

      #3
      Re: wxPython and Linux dependencies

      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.
      >
      diffuser78@gmai l.com 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


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

      Every help is appreciated.

      Comment

      • John Salerno

        #4
        Re: wxPython and Linux dependencies

        diffuser78@gmai l.com 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?

        Comment

        • diffuser78@gmail.com

          #5
          Re: wxPython and Linux dependencies

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

          John Salerno wrote:
          diffuser78@gmai l.com 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?

          Comment

          • Nick Vatamaniuc

            #6
            Re: wxPython and Linux dependencies

            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.



            diffuser78@gmai l.com wrote:
            How can we find that it is not using the right version of Python ?
            >
            John Salerno wrote:
            diffuser78@gmai l.com 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?

            Comment

            • Frithiof Andreas Jensen

              #7
              Re: wxPython and Linux dependencies


              <diffuser78@gma il.comwrote in message
              news:1152216808 .787544.130220@ s16g2000cws.goo glegroups.com.. .
              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><somethi ng....

              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!


              Comment

              • John Salerno

                #8
                Re: wxPython and Linux dependencies

                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.)

                Comment

                • diffuser78@gmail.com

                  #9
                  Re: wxPython and Linux dependencies

                  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.
                  >
                  >
                  >
                  diffuser78@gmai l.com wrote:
                  How can we find that it is not using the right version of Python ?

                  John Salerno wrote:
                  diffuser78@gmai l.com 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?

                  Comment

                  Working...