diff --git a/bin/compile b/bin/compile
index 1692b935a187d93056c2efeaa5c657ad1b056507..10d5ebda0ca57d96b4ecc58e52df041973ff8b28 100755
--- a/bin/compile
+++ b/bin/compile
@@ -163,9 +163,6 @@ if [ ! -f requirements.txt ] && [ ! -f Pipfile ]; then
   echo "-e ." > requirements.txt
 fi
 
-# Uninstall removed dependencies with Pip.
-source $BIN_DIR/steps/pip-uninstall
-
 # Mercurial support.
 source $BIN_DIR/steps/mercurial
 
@@ -184,6 +181,9 @@ source $BIN_DIR/steps/gdal
 # Install dependencies with Pip (where the magic happens).
 source $BIN_DIR/steps/pip-install
 
+# Uninstall removed dependencies with Pip.
+source $BIN_DIR/steps/pip-uninstall
+
 # Support for NLTK corpora.
 sub-env $BIN_DIR/steps/nltk