diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 04e630723..456a2fa19 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -277,6 +277,10 @@ jobs:
       # pstuil is an optional package to detect the number of CPU for compiling mmcv
       - name: Install psutil
         run: python -m pip install psutil
+      # the directory for header files for the Python C-API could be wrong since setuptools>=65.2.0
+      - name: Install specified version for setuptools when python==3.10
+        run: python -m pip install 'setuptools<=65.1.0'
+        if: ${{matrix.python-version == '3.10'}}
       - name: Build and install
         run: rm -rf .eggs && python -m pip install -e .
       - name: Validate the installation
@@ -332,6 +336,10 @@ jobs:
       # pstuil is an optional package to detect the number of CPU for compiling mmcv
       - name: Install psutil
         run: python -m pip install psutil
+      # the directory for header files for the Python C-API could be wrong since setuptools>=65.2.0
+      - name: Install specified version for setuptools when python==3.10
+        run: python -m pip install 'setuptools<=65.1.0'
+        if: ${{matrix.python-version == '3.10'}}
       - name: Build and install
         run: rm -rf .eggs && python -m pip install -e .
       - name: Validate the installation