cannot import glib in python shell

Discussion in 'Python' started by uticdmarceau2007@yahoo.ca, Dec 23, 2009.

  1. Guest

    Hello everyone,

    I'm trying to document a recipe to get the anomos python sources running
    on winxp Pentium3 laptop. I've installed the latest 2.6
    python/mingw/msys/gtk and related binaries(glib, etc...)

    This link has all the information about running anomos python sources on
    a linux box:
    http://anomos.info/trac/wiki/KnowledgeBase

    -------------------------------
    Here is my msys/home/user/.profile:
    CC='/mingw/bin/gcc.exe '
    CFLAGS='-march=pentium3 -mtune=i586 -mthreads -O2 -fomit-frame-pointer
    -mms-bitfields -pipe '
    CPPFLAGS='-I/mingw/include -DMINGW32 -D__MINGW32__ '
    CXXFLAGS="${CFLAGS}"
    LDFLAGS='-L/mingw/lib -Wl,--enable-auto-image-base
    -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc '
    PKG_CONFIG_PATH="C:\MinGW\lib\pkgconfig"
    export CC CFLAGS CPPFLAGS CXXFLAGS LDFLAGS PKG_CONFIG_PATH

    export
    PATH=.:/c/OpenSSL:/c/OpenSSL/bin:/c/OpenSSL/lib:/c/Venster/venster:/c/Venster:/c/gccxml:/c/Python26:/c/Python26/Lib/site-packages/M2Crypto:/c/Python26/DLLs:/c/Python26/tcl/dde1.3:/c/Python26/tcl/reg1.2:/c/Python26/tcl/tix8.4.3:/c/gtkwin/bin:c/gtkwin/lib:/c/gtkmm/bin:/c/gtkmm/lib:/c/gtkmm/redist:/mingw/bin:/bin:/usr/local/bin:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:"/c/Program
    Files/Common Files/Ahead/Lib"
    export
    PKG_CONFIG_PATH=/c/Python26/Lib/pkgconfig:/c/gtkmm/lib/pkgconfig:/c/gtkwin/lib/pkgconfig:/c/gtkwin/manifest:/c/mingw/lib/pkgconfig
    export
    LD_LIBRARY_PATH=/c/gtkmm/redist:/c/gtkmm/bin:/c/gtkwin/bin:/c/gtkwin/lib:/c/mingw/lib
    -------------------------
    The odd thing is that I can compile a c++ source file that needs glib
    and it's running/linking, but the python doesn't find glib when I do
    "import glib" from the python shell.
    gcc -Wall -o anomos.exe pkg-config --cflags gtkmm-2.4 pangomm-1.4
    anomos.cc pkg-config --libs gtkmm-2.4 pangomm-1.4 -lstdc++
    glib is at least in two dirs:gtkwin/lib and mingw/lib because the
    binaries are installed in gtkwin/lib and I compile glib with the latest
    sources and installed/tested them from mingw/lib.
    ---------------------------------

    I think ideally what I'm requesting is to have the mingw/python/gtk
    environments to be harmonized. I'm close. I can do the following:
    python
    import sys
    import gtk
    blah = gtk.Window(0)
    blah.show()
    , but when I do
    import glib
    ERROR!!!
    if I cd to a certain dir in glib sources, there were two .py files, but
    I didn't know where to place them in the python26 dir.
    >From that dir, I can run the python shell, import glib and then it gives

    me an error about no module for gdb...so it's none stop...with regards
    to the import glib issue at present.

    Any help towards this would be greatly appreciated.

    Cheers,
    David Marceau
     
    , Dec 23, 2009
    #1
    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. Daniel C Bastos

    glib/gtk and the standard

    Daniel C Bastos, Jul 6, 2003, in forum: C Programming
    Replies:
    3
    Views:
    538
    Dan Pop
    Jul 7, 2003
  2. Erwan Loisant

    glib: problem with GArray

    Erwan Loisant, Oct 22, 2004, in forum: C Programming
    Replies:
    5
    Views:
    466
    Erwan Loisant
    Oct 22, 2004
  3. Arjan

    Glib IO channels in Windows

    Arjan, Mar 18, 2005, in forum: C Programming
    Replies:
    2
    Views:
    515
    Mark McIntyre
    Mar 18, 2005
  4. TPJ

    GLib problems

    TPJ, Dec 5, 2005, in forum: C Programming
    Replies:
    0
    Views:
    302
  5. Tor Lillqvist
    Replies:
    0
    Views:
    430
    Tor Lillqvist
    Dec 23, 2009
Loading...

Share This Page