views:

61

answers:

2

I wrote a Python extension in C, and my python program uses that extension. In order for it to work, I would have to install the extension on the user's system before my program can run. Is there a way to bypass that installation step and somehow just have the extension in my python package? The only compiled part obviously is the extension (since it's in C).

+2  A: 

You can avoid having some one to install it independently but you can not avoid installation completely. If his computing platform differs from yours, he will have to build the extension. What can be done is that you setup a package distribution using distutils. This way the package could be installed or built. You can include the "C" extension in your package.

For some standard platform, you can then provide binary package distribution. The user should have the ability to rebuild, if the binary package is not working out for him.

pyfunc
+1  A: 

just put the .d compiled python dll in the same directory as your python script. then you'll be able to import it.

amwinter