[Tutor] Need some help with setuptools for my project.

Anubhav Yadav anubhav1691 at gmail.com
Tue Apr 7 10:31:21 CEST 2015


You might consider packaging your project as a script so that it can be run
> by the user from the command line. See:
> https://docs.python.org/2/distutils/setupscript.html#installing-scripts
>
> Provided that you add something like #!/usr/bin/python to the top of
> scorer.py, 'python setup.py install’ will make it executable and move it to
> /usr/local/bin (on mac anyway) so that it can be run from the command line
> without the need to be in a specific directory or use the python command.
> You can even drop the .py from the file name so the user would just type in
> ‘scorer’ to start the script.
>
>
Hi, as you can see my project doesn't have any single script. It is now
made of many modules, and the app.py imports all the modules and executes
them in the main() function. I also have an __main__.py where I call the
main() function. I can run my project from the root of the directory using
``python -m scorer``. But if I use setuptools and install python using
``sudo python setup.py install``, setuptools says that my script is
installed but I don't know how to run it?



> If you’d like to make your script available to the wider community, you
> can put it on PyPI. See:
> https://docs.python.org/2/distutils/packageindex.html
>

I would love to upload my script to PyPi, but first I need to figure out if
my project is getting installed properly using setuptools or not.


-- 
Regards,
Anubhav Yadav


More information about the Tutor mailing list