diff --git a/.github/workflows/ciwheel.yml b/.github/workflows/ciwheel.yml
index 24792583c756a97dc48624a294e9e1ebff19d008..77f094fbcbf7add4b20a973498353388dcaf53ae 100644
--- a/.github/workflows/ciwheel.yml
+++ b/.github/workflows/ciwheel.yml
@@ -24,6 +24,8 @@ jobs:
         with:
           fetch-depth: 0
           submodules: recursive
+      - name: Update pip
+        run: python -m pip install --upgrade pip
 
       - name: Build wheels Linux
         if: ${{ startsWith(matrix.os, 'ubuntu') }}
@@ -66,6 +68,8 @@ jobs:
     steps:
       - name: Set up Python
         uses: actions/setup-python@v2
+      - name: Update pip
+        run: python -m pip install --upgrade pip
       - name: Get packages
         run: python -m pip install numpy setuptools scikit-build ninja cmake
       - uses: actions/checkout@v2
diff --git a/.github/workflows/sanitize.yml b/.github/workflows/sanitize.yml
index 1e7e371a56f9a85dab837985800b4ebcf6a584dd..f1400f87abfa256abbc3fa18c68354aced0f5367 100644
--- a/.github/workflows/sanitize.yml
+++ b/.github/workflows/sanitize.yml
@@ -27,6 +27,8 @@ jobs:
         uses: actions/checkout@v2
         with:
           submodules: recursive
+      - name: Update pip
+        run: python -m pip install --upgrade pip
       - name: Build arbor
         run: |
           mkdir build
diff --git a/.github/workflows/test-everything.yml b/.github/workflows/test-everything.yml
index 3a829fa6974395922f91756302b58f85fc35eb98..d540ee525605118675c9cfaf15519f28e95a8a6f 100644
--- a/.github/workflows/test-everything.yml
+++ b/.github/workflows/test-everything.yml
@@ -110,6 +110,8 @@ jobs:
         uses: actions/setup-python@v2
         with:
           python-version: ${{ matrix.config.py }}
+      - name: Update pip
+        run: python -m pip install --upgrade pip
       - name: OpenMPI cache
         uses: actions/cache@v2
         id:   cache-ompi
@@ -200,6 +202,8 @@ jobs:
     name: "Pip build test + Python examples test"
     runs-on: ubuntu-latest
     steps:
+      - name: Update pip
+        run: python -m pip install --upgrade pip
       - name: Install Python packages
         run:  pip install numpy setuptools scikit-build ninja cmake
       - name: Clone w/ submodules
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index 10220bf93a36431e415b0b03ffb019d1ba1d4f4d..10e7e246e8285b2f5d92aa9eb4b2aa53e4202060 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -85,8 +85,7 @@ file(COPY "${PROJECT_SOURCE_DIR}/VERSION" DESTINATION "${python_mod_path}")
 file(WRITE "${CMAKE_BINARY_DIR}/install-prefix" "${CMAKE_INSTALL_PREFIX}")
 
 execute_process(
-    COMMAND ${PYTHON_EXECUTABLE} -c
-    "import sys,sysconfig;pfx=sys.stdin.read();print(sysconfig.get_path('platlib',vars={} if pfx=='' else {'base':pfx,'platbase':pfx}))"
+    COMMAND ${PYTHON_EXECUTABLE} "${PROJECT_SOURCE_DIR}/scripts/where.py"
     INPUT_FILE "${CMAKE_BINARY_DIR}/install-prefix"
     OUTPUT_VARIABLE ARB_PYTHON_LIB_PATH_DEFAULT
     OUTPUT_STRIP_TRAILING_WHITESPACE)
diff --git a/scripts/where.py b/scripts/where.py
new file mode 100644
index 0000000000000000000000000000000000000000..1abf399ec558213336718ddcfe8998f44747e074
--- /dev/null
+++ b/scripts/where.py
@@ -0,0 +1,12 @@
+import sys,sysconfig
+
+pfx=sys.stdin.read()
+try:
+    #override scheme on debian/ubuntu py3.10, where 'posix_local' is set and malfunctioning.
+    if sysconfig.get_default_scheme()=='posix_local':
+        print(sysconfig.get_path('platlib',vars={} if pfx=='' else {'base':pfx,'platbase':pfx},scheme='posix_prefix'))
+        sys.exit()
+except AttributeError:
+    #we're on Python <= 3.9, no scheme setting required and get_default_scheme does not exist.
+    pass
+print(sysconfig.get_path('platlib',vars={} if pfx=='' else {'base':pfx,'platbase':pfx}))