By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,930 Members | 1,383 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,930 IT Pros & Developers. It's quick & easy.

Trouble importing module using swig and python

P: n/a

I am beginner in python.
I am working through the tutorial examples from and
have run into some problems. I took the following command instructions from
the tutorial on

I have written example.c and example.i as described in the above tutorial.
My first attempt at compiling the libraries was this:
$ swig -python example.i

it should produce and example_wrap.c files . But i am not getting file in the folder where i am executing swig -python example.i

But with example_wrap.c file i can able to produce shared object
gcc -c example.c example_wrap.c \

gcc -shared example.o example_wrap.o -o

and doing

ld -shared example.o example_wrap.o -o

and when iam trying to import from python like

import example

it is saying no module named example.

My first Question is that should i get in folder and second
Question is that if it is not neccessary then where i am going wrong ??
Please help me in this regard.


View this message in context:
Sent from the Python - python-list mailing list archive at

Oct 11 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.