What am I doing wrong with SWIG in OS X Snow Leopard?

Discussion in 'Python' started by Zectbumo, Oct 20, 2009.

  1. Zectbumo

    Zectbumo Guest

    Here are the steps I am doing that cause me to get the error
    ImportError: No module named _hi.
    I'm running OS X 10.6.1 What am I doing wrong?

    mkdir -p /tmp/my_swig_test
    cd /tmp/my_swig_test
    cat >hi.c<<.
    #include <stdio.h>
    void hello(void) {printf("Hello World\n");}
    ..
    gcc -shared -o libhi.dylib hi.c
    cat >hi.i<<.
    %module hi
    %include "hi.c"
    ..
    swig -python hi.i
    gcc -shared -I/System/Library/Frameworks/Python.framework/Headers -
    framework Python -L. -lhi -o _hi.dylib hi_wrap.c
    DYLD_LIBRARY_PATH=. python -c 'import hi; hi.hello()'
     
    Zectbumo, Oct 20, 2009
    #1
    1. Advertising

  2. Zectbumo

    Aahz Guest

    In article <>,
    Zectbumo <> wrote:
    >
    >Here are the steps I am doing that cause me to get the error
    >ImportError: No module named _hi.
    >I'm running OS X 10.6.1 What am I doing wrong?


    You probably want to ask on pythonmac-sig
    --
    Aahz () <*> http://www.pythoncraft.com/

    Member of the Groucho Marx Fan Club
     
    Aahz, Oct 23, 2009
    #2
    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. Alia Khouri

    python version in snow leopard?

    Alia Khouri, Jun 9, 2009, in forum: Python
    Replies:
    2
    Views:
    287
    Alia K
    Jun 9, 2009
  2. Roedy Green

    Java hom foer the Mac Snow Leopard?

    Roedy Green, Sep 2, 2009, in forum: Java
    Replies:
    7
    Views:
    417
    Kevin McMurtrie
    Sep 7, 2009
  3. Xiao Yu
    Replies:
    0
    Views:
    456
    Xiao Yu
    Oct 13, 2009
  4. Xiao
    Replies:
    1
    Views:
    503
    Ned Deily
    Dec 1, 2009
  5. dk
    Replies:
    2
    Views:
    468
    Ned Deily
    Jul 14, 2010
Loading...

Share This Page