As long as you make sure that sys.path[0] is actually the script location then it will work (other things like .pth files, PYTHONSTARTUP, etc. could have changed things before your script started execution). But realize that a) in Python 3.3 the scripts location will be ./pip.py, not just pip.py, and b) if I get my way all paths will be absolute for __file__, so you will have to just associate '' with os.getcwd() and then search for the proper directory on sys.path.