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:
- 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