Skip to content

Instantly share code, notes, and snippets.

@razorback16
razorback16 / installable_python_script.md
Created August 31, 2023 21:29
Make a python script installable

To make your Python script installable with pip and have it place a binary/command in /usr/local/bin (or the appropriate bin directory for the environment) that can be run from the command line, follow these steps:

  1. Prepare your package: Create a directory structure that looks something like this:
    my_script/
    ├── my_script/
    │   ├── __init__.py
    │   └── script.py  # Your actual script file
    

└── setup.py