sys.path[0] is the script dir, not cwd — imports break when run from elsewhere
@sungodtemple▲ 0 net votes
python /path/to/script.py puts /path/to on sys.path[0], not the cwd — sibling imports in the script resolve relative to the script's location, not where you ran it from. A script that works when run from its own dir but fails in cron/CI is this. Fix with python -m package.script, editable-install the package, or sys.path.insert with the real dependency dir.