My Python cannot find wxPython

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Equis Uno

    My Python cannot find wxPython

    Hi,

    I'm trying to run some Python software I downloaded off of sf.net.

    It's called Boa.

    It uses wxPython.

    It appears my install of Python cannot see my install of wxPython.

    My question:
    How can I tell Python where wxPython lives?

    Does Python have a concept like PATH or CLASSPATH?

    Some more details about my Python-wxPython problem:

    When I run Python on my Linux box I see this:


    dhcpclient-220-7:/# python
    Python 2.3.3 (#1, Jan 9 2004, 22:14:55)
    [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2
    Type "help", "copyright" , "credits" or "license" for more information.[color=blue][color=green][color=darkred]
    >>>[/color][/color][/color]

    So, I'm running Python 2.3.3.

    When I look in /usr/local/share I see wxPython:


    dhcpclient-220-7:/# du /usr/local/share/wx/2.4
    228 /usr/local/share/wx/2.4/afm
    420 /usr/local/share/wx/2.4/gs_afm
    652 /usr/local/share/wx/2.4
    dhcpclient-220-7:/#

    When I run this "Boa" software I downloaded, I see this:

    dhcpclient-220-7:/pt/TThier/Languages/python/boa-constructor-0.2.3# ./Boa.py
    Starting Boa Constructor v0.2.3
    importing wxPython
    Traceback (most recent call last):
    File "./Boa.py", line 179, in ?
    from wxPython import wx
    ImportError: No module named wxPython
    dhcpclient-220-7:/pt/TThier/Languages/python/boa-constructor-0.2.3#



    How do I get past this error:
    ImportError: No module named wxPython

    thanks,

    -moi
  • Leif K-Brooks

    #2
    Re: My Python cannot find wxPython

    Equis Uno wrote:[color=blue]
    > Does Python have a concept like PATH or CLASSPATH?[/color]

    Yes, the PYTHONPATH environment variable.

    Comment

    • Equis Uno

      #3
      Re: My Python cannot find wxPython

      I got Boa Constructor working.

      I'm not sure what the problem was so I 'wiped the slate clean'.

      I downloaded Python-2.3.3.tgz
      I unpacked and installed it with this script:

      #! /bin/bash

      set -x
      export DESTDIR=/python/
      /bin/rm -rf /python
      mkdir /python
      make clean
      make distclean
      ../configure --enable-unicode=ucs4 --prefix /python --exec-prefix /python
      make
      make test
      make install
      cd /bin/
      mv python pythonWhichIUse dToUse
      ln -s /python/bin/python .

      Next, I added these tokens to my LD_LIBRARY_PATH
      /python/lib/python2.3/lib-dynload



      Next, I downloaded wxPythonSrc-2.4.2.4.tar.gz

      I unpacked and installed it with this script:

      #! /bin/bash

      set -x

      export WXPREF=/python/wxPython

      cd /CD/python/wxPythonSrc-2.4.2.4/

      mkdir build
      cd build
      .../configure --with-gtk \
      --prefix=$WXPREF \
      --enable-rpath=$WXPREF/lib \
      --with-opengl \
      --enable-geometry \
      --enable-optimise \
      --enable-debug_flag \
      --with-libjpeg=builtin \
      --with-libpng=builtin \
      --with-libtiff=builtin \
      --with-zlib=builtin

      make
      make install
      cd ../wxPython
      /bin/python setup.py WX_CONFIG=/python/wxPython/bin/wx-config build install

      cd demo
      /bin/python demo.py

      Next, I added these tokens to my LD_LIBRARY_PATH /python/wxPython/lib




      Next, I downloaded boa-constructor-0.2.3.src.zip

      I unzipped it.

      I ran this and it worked great:
      /bin/python Boa.py

      -moi

      Comment

      • Uwe Grauer

        #4
        Re: My Python cannot find wxPython

        Equis Uno wrote:[color=blue]
        > ...
        >
        > Next, I downloaded boa-constructor-0.2.3.src.zip
        >[/color]

        Get Boa from cvs on sf.net.
        Actual version is 0.2.8

        Uwe

        Comment

        Working...