Python – install script to system

EDIT: This answer deals only with installing executable scripts into /usr/bin. I assume you have basic knowledge on how files work.

Create your script and place it in your project like this:


In your file do this:

from setuptools import setup
# you may need setuptools instead of distutils

    # basic stuff here
    scripts = [

Then type

python install

Basically that’s it. There’s a chance that your script will land not exactly in /usr/bin, but in some other directory. If this is the case, type

python install --help

and search for --install-scripts parameter and friends.

Leave a Comment