diff --git a/centos/Dockerfile b/centos/Dockerfile
index bbc8a5b74f75607bd5f5834d99aa74e435ce8b4f..19645ed5c495bdafa9b5451bfa802595305e49d4 100644
--- a/centos/Dockerfile
+++ b/centos/Dockerfile
@@ -353,21 +353,6 @@ RUN version=1.6.0 && \
     rm /opt/mxnet-1.6.0-manual-cuda-arch-flags.patch && \
     ninja -C build
 
-# pybind11
-ARG pybind11_VERSION=2.13.5
-RUN source /etc/profile && \
-    cd /tmp && \
-    curl -sSL -o pybind11-${pybind11_VERSION}.tar.gz https://github.com/pybind/pybind11/archive/v${pybind11_VERSION}.tar.gz && \
-    tar -xf pybind11-${pybind11_VERSION}.tar.gz && \
-    cd pybind11-${pybind11_VERSION} && \
-    cmake -S. -B build -G Ninja \
-        -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local \
-        -DPYBIND11_TEST=off \
-        && \
-    ninja -C build install && \
-    cd .. && \
-    rm -rf pybind11-${pybind11_VERSION}*
-
 # pylon (Basler cameras)
 ARG pylon_VERSION=5.2.0.13457
 RUN cd /tmp && \
@@ -468,6 +453,21 @@ RUN version=3.8.19 && \
     rm -rf Python-${version}* && \
     ldconfig
 
+# pybind11
+ARG pybind11_VERSION=2.13.5
+RUN source /etc/profile && \
+    cd /tmp && \
+    curl -sSL -o pybind11-${pybind11_VERSION}.tar.gz https://github.com/pybind/pybind11/archive/v${pybind11_VERSION}.tar.gz && \
+    tar -xf pybind11-${pybind11_VERSION}.tar.gz && \
+    cd pybind11-${pybind11_VERSION} && \
+    cmake -S. -B build -G Ninja \
+        -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local \
+        -DPYBIND11_TEST=off \
+        && \
+    ninja -C build install && \
+    cd .. && \
+    rm -rf pybind11-${pybind11_VERSION}*
+
 # Python 3.9
 RUN version=3.9.19 && \
     source /etc/profile && \