diff --git a/centos/python/make-python-portable.py b/centos/python/make-python-portable.py
index e93c0c302e20918400eaf92296a8cbd3b1902fe1..7d4d1d1e2e2473dcf50a3a88ec206680c471a05e 100755
--- a/centos/python/make-python-portable.py
+++ b/centos/python/make-python-portable.py
@@ -34,6 +34,9 @@ def make_python_portable(interpreter):
     root_dir = bin_dir.parent
     lib_dir = root_dir / "lib"
 
+    # Patch interpreter to find all libraries
+    check_call(["patchelf", "--set-rpath", "$ORIGIN/../lib", interpreter])
+
     # Install all dependencies
     targets = [
         interpreter,
@@ -48,7 +51,6 @@ def make_python_portable(interpreter):
             shutil.copy2(str(path), str(lib_dir / name))
 
     # Patch targets and dependencies to find each other
-    check_call(["patchelf", "--set-rpath", "$ORIGIN/../lib", interpreter])
     for target in targets[1:]:
         num_parents = len(target.relative_to(lib_dir).parts) - 1
         rpath = Path("$ORIGIN")