I'm trying to get an example that shows how to install python scripts so they are available on the command line (original example from this blog). I'm installing the module
pip3 install -e .
When I run the command my_project
at the command prompt (zsh) it just says
zsh: command not found: my_project
Why wouldn't it be able to find the installed package as a command? My best guess is that it might be a path issue like this question, but that's for an older MacOS and doesn't seem to apply. I'm running Ventura.
The directory structure looks like this:
entry_points_project/
setup.py
my_project/init.py
main.py
The setup.py file:
from setuptools import setup
setup(
name="my_project",
version="0.1.0",
packages=["my_project"],
entry_points={
"console_scripts": [
"my_project = my_project.__main__:main"
]
},
)
The main.py file: import sys
def main(args=None):
if args is None:
args = sys.argv[1:]
print("This is the main routine.")
print("It should do something interesting.")
if __name__ == "__main__":
sys.exit(main())