diff --git a/bin/compile b/bin/compile
index 1532cddcaaac46f1a6377eca060ad0106135597b..3f3c04c97961290704feed8ec9be29a0f24362b9 100755
--- a/bin/compile
+++ b/bin/compile
@@ -158,7 +158,10 @@ source $BIN_DIR/steps/python
 # Sanity check for setuptools/distribute.
 source $BIN_DIR/steps/setuptools
 
-# Mercurial support.
+# Fix egg-links.
+source $BIN_DIR/steps/eggpath-fix
+
+# Pipenv support.
 source $BIN_DIR/steps/pipenv
 
 # If no requirements.txt file given, assume `setup.py develop` is intended.
@@ -215,15 +218,8 @@ bpwatch start post_compile
   source $BIN_DIR/steps/hooks/post_compile
 bpwatch stop post_compile
 
-set +e
-# rewrite build dir in egg links to /app so things are found at runtime
-find .heroku/python/lib/python*/site-packages/ -name "*.pth" -print0 2> /dev/null | xargs -r -0 -n 1 sed -i -e "s#$(pwd)#/app#" &> /dev/null
-set -e
-
-set +e
-# Support for PyPy
-find .heroku/python/lib-python/*/site-packages/  -name "*.pth" -print0 2> /dev/null | xargs -r -0 -n 1 sed -i -e "s#$(pwd)#/app#" &> /dev/null
-set -e
+# Fix egg-links, again.
+source $BIN_DIR/steps/eggpath-fix2
 
 # Store new artifacts in cache.
 bpwatch start dump_cache
diff --git a/bin/steps/eggpath-fix b/bin/steps/eggpath-fix
new file mode 100644
index 0000000000000000000000000000000000000000..65d16d2b322ab359c853ce5d21882666457fae34
--- /dev/null
+++ b/bin/steps/eggpath-fix
@@ -0,0 +1,11 @@
+set +e
+# delete any existing egg links, to uninstall exisisting installations.
+find .heroku/python/lib/python*/site-packages/ -name "*.egg-link" -delete 2> /dev/null
+find .heroku/python/lib/python*/site-packages/ -name "*.pth" -print0 2> /dev/null | xargs -r -0 -n 1 sed -i -e "s#/app/#/$(pwd)/#" &> /dev/null
+set -e
+
+set +e
+# Support for the above, for PyPy.
+find .heroku/python/lib-python/*/site-packages/ -name "*.egg-link" -print0 2> /dev/null | xargs -r -0 -n 1 sed -i -e "s#/app/#$(pwd)/#" &> /dev/null
+find .heroku/python/lib-python/*/site-packages/ -name "*.pth" -print0 2> /dev/null | xargs -r -0 -n 1 sed -i -e "s#/app/#/$(pwd)/#" &> /dev/null
+set -e
\ No newline at end of file
diff --git a/bin/steps/eggpath-fix2 b/bin/steps/eggpath-fix2
new file mode 100644
index 0000000000000000000000000000000000000000..f119a2914396d58cc0197c53787d812d8b27db42
--- /dev/null
+++ b/bin/steps/eggpath-fix2
@@ -0,0 +1,9 @@
+set +e
+# rewrite build dir in egg links to /app so things are found at runtime
+find .heroku/python/lib/python*/site-packages/ -name "*.pth" -print0 2> /dev/null | xargs -r -0 -n 1 sed -i -e "s#$(pwd)#/app#" &> /dev/null
+set -e
+
+set +e
+# Support for PyPy
+find .heroku/python/lib-python/*/site-packages/  -name "*.pth" -print0 2> /dev/null | xargs -r -0 -n 1 sed -i -e "s#$(pwd)#/app#" &> /dev/null
+set -e
\ No newline at end of file
diff --git a/bin/steps/pip-install b/bin/steps/pip-install
index cbec332642150e01d58d5a1ab9536657ceaa4ff3..6fe6e72ee6bd5ab93da92b5b2e800c1b37fd7169 100755
--- a/bin/steps/pip-install
+++ b/bin/steps/pip-install
@@ -1,19 +1,6 @@
 # Install dependencies with Pip.
 puts-step "Installing requirements with pip"
 
-set +e
-# delete any existing egg links, to uninstall exisisting installations.
-find .heroku/python/lib/python*/site-packages/ -name "*.egg-link" -delete 2> /dev/null
-find .heroku/python/lib/python*/site-packages/ -name "*.pth" -print0 2> /dev/null | xargs -r -0 -n 1 sed -i -e "s#/app/#/$(pwd)/#" &> /dev/null
-set -e
-
-set +e
-# Support for the above, for PyPy.
-find .heroku/python/lib-python/*/site-packages/ -name "*.egg-link" -print0 2> /dev/null | xargs -r -0 -n 1 sed -i -e "s#/app/#$(pwd)/#" &> /dev/null
-find .heroku/python/lib-python/*/site-packages/ -name "*.pth" -print0 2> /dev/null | xargs -r -0 -n 1 sed -i -e "s#/app/#/$(pwd)/#" &> /dev/null
-set -e
-
-
 [ ! "$FRESH_PYTHON" ] && bpwatch start pip_install
 [ "$FRESH_PYTHON" ] && bpwatch start pip_install_first
 
diff --git a/test/run b/test/run
index b7e14c1a8e874fd8ec5bb8e895596365d1548dad..c14b2b1f4f1771673e337ebf44c87543e097ab28 100755
--- a/test/run
+++ b/test/run
@@ -1,18 +1,17 @@
 #!/usr/bin/env bash
 
-testPipenvVersion() {
-  compile "pipenv-version"
-  assertCaptured "3.6.0"
-  assertCapturedSuccess
-}
-
 
 testPipenv() {
   compile "pipenv"
+  debug
   assertCapturedSuccess
 }
 
-
+testPipenvVersion() {
+  compile "pipenv-version"
+  assertCaptured "3.6.0"
+  assertCapturedSuccess
+}
 
 testNoRequirements() {
   compile "no-requirements"
diff --git a/vendor/pip-9.0.1.tar.gz b/vendor/pip-9.0.1.tar.gz
deleted file mode 100644
index 5416b0d26ae5c66528941f4eba021f6a5beb2106..0000000000000000000000000000000000000000
Binary files a/vendor/pip-9.0.1.tar.gz and /dev/null differ