I'm using distutils.core.setup for the first time. I got it to install my module in /usr/lib/python/site-packages.
If I run python from any directory and do import my_module
it all works great.
However, I need to run my module as script. It's not intended as a library, but rather as an application. If I run from terminal python my_module
it does not find the file.
I wanted to make an executable script that will run my module and put a sym link to it in /usr/bin, but that seems like a hacky way to solve this. I presume distutils has something to install your module as an executable script, except I wasn't able to find it. Could someone please point me to an example or doc file for this?
Edit: Also, if this is not the right way to distribute a python application, what should I use instead?
Use
distutils.core.setup(scripts=['myprogram'])
instead of py_modules=['mymodule.py']
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With