Python: Best way to add to sys.path relative to the current running script December 8, 2022 by Tarik This is what I use: import os, sys sys.path.append(os.path.join(os.path.dirname(__file__), "lib"))