Remove a bit of sys.path hackery.

Previously would reconfigure sys.path during the execution of
the recipe code in order to make `from recipe_engine import ...` work.
This changes it so that all known executions of (namely and the two bundled launcher scripts) just set PYTHONPATH
correctly prior to invoking

R=fancl, yiwzhang

Bug: 1462728
Change-Id: Ice5a9351a81dcdd46db59afb42f6a5b85049cfa3
Reviewed-by: Yiwei Zhang <>
Commit-Queue: Robbie Iannucci <>
diff --git a/recipe_engine/ b/recipe_engine/
index 93a8590..18da041 100755
--- a/recipe_engine/
+++ b/recipe_engine/
@@ -55,28 +55,12 @@
 del _hack_lookup_codecs
-# Hack 4; Drop sys.path[0], which is ROOT_DIR/recipe_engine. This prevents user
-# recipe code from doing things like `import util` and getting
-# recipe_engine/
-# This is needed because lives inside of the recipe_engine folder; when
-# invokes this as `python path/to/recipe_engine/`, python puts
-# this directory at the front of sys.path.
-# A better long-term fix would be to move up one level so that the
-# automatically-prepended directory would remove the need for this and the
-# ROOT_DIR bit below.
-sys.path = sys.path[1:]
   import urllib3.contrib.pyopenssl
 except ImportError:
-ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
-sys.path.insert(0, ROOT_DIR)
 from recipe_engine.internal import debugger