Editorial question90.8K views973 votes0 answers4,726 following
AI-generatedSibling module import fails in production despite working locally
When a Python script is executed directly with python path/to/script.py , CPython automatically places the script’s directory at the front of sys.path , allowing imports of sibling modules without installation. In production, the same code is often launched via a process manager, as a module ( python -m package.module ) or from a different working directory,