diff --git a/tools/run_tests/build_python.sh b/tools/run_tests/build_python.sh
index 0eba1c637798a4e17b0624a2810829eac03eaa69..b14597804fe119971f33ab157a422838a24676f3 100755
--- a/tools/run_tests/build_python.sh
+++ b/tools/run_tests/build_python.sh
@@ -38,5 +38,5 @@ rm -rf python2.7_virtual_environment
 virtualenv -p /usr/bin/python2.7 python2.7_virtual_environment
 source python2.7_virtual_environment/bin/activate
 pip install enum34==1.0.4 futures==2.2.0 protobuf==3.0.0-alpha-1
-CFLAGS=-I$root/include LDFLAGS=-L$root/libs/opt pip install src/python/src
+CFLAGS=-I$root/include LDFLAGS=-L$root/libs/$CONFIG pip install src/python/src
 pip install src/python/interop
diff --git a/tools/run_tests/run_python.sh b/tools/run_tests/run_python.sh
index fa1497aee478a8e2b262effc1f729a03704eb517..f0e091f47a1e4936b03744dc16a19853c0c6cdcc 100755
--- a/tools/run_tests/run_python.sh
+++ b/tools/run_tests/run_python.sh
@@ -34,6 +34,6 @@ set -ex
 cd $(dirname $0)/../..
 
 root=`pwd`
-export LD_LIBRARY_PATH=$root/libs/opt
+export LD_LIBRARY_PATH=$root/libs/$CONFIG
 source python2.7_virtual_environment/bin/activate
 python2.7 -B $*