<#20759 Building wheels in CI fails with `ImportEr...
# github-notifications
c
#20759 Building wheels in CI fails with `ImportError` for `_psutil_osx` on arm64 macOS Issue created by huonw Describe the bug Currently building wheels in CI is failing with import errors: For instance, https://github.com/pantsbuild/pants/actions/runs/8568580132/job/23507811563?pr=20754
Copy code
./pants run src/python/pants_release/release.py -- build-wheels
...
   Compiling humansize v1.1.1
    Finished dev [optimized + debuginfo] target(s) in 2m 26s
There is no pantsd metadata at /Users/gha/actions-runner/_work/pants/pants/.pants.d/pids/4ad09567af61/pantsd.
Traceback (most recent call last):
  File "/Users/gha/actions-runner/_work/pants/pants/src/python/pants/bin/pants_loader.py", line 18, in <module>
    from pants.bin.pants_runner import PantsRunner
  File "/Users/gha/actions-runner/_work/pants/pants/src/python/pants/bin/pants_runner.py", line 14, in <module>
    from pants.base.exception_sink import ExceptionSink
  File "/Users/gha/actions-runner/_work/pants/pants/src/python/pants/base/exception_sink.py", line 16, in <module>
    import psutil
  File "/Users/gha/.cache/pants/pants_dev_deps/831406c75048af12c49c13e2acf237de35c138fe.venv/lib/python3.9/site-packages/psutil/__init__.py", line 123, in <module>
    from . import _psosx as _psplatform
  File "/Users/gha/.cache/pants/pants_dev_deps/831406c75048af12c49c13e2acf237de35c138fe.venv/lib/python3.9/site-packages/psutil/_psosx.py", line 14, in <module>
    from . import _psutil_osx as cext
ImportError: dlopen(/Users/gha/.cache/pants/pants_dev_deps/831406c75048af12c49c13e2acf237de35c138fe.venv/lib/python3.9/site-packages/psutil/_psutil_osx.cpython-39-darwin.so, 2): no suitable image found.  Did find:
	/Users/gha/.cache/pants/pants_dev_deps/831406c75048af12c49c13e2acf237de35c138fe.venv/lib/python3.9/site-packages/psutil/_psutil_osx.cpython-39-darwin.so: mach-o, but wrong architecture
	/Users/gha/.cache/pants/pants_dev_deps/831406c75048af12c49c13e2acf237de35c138fe.venv/lib/python3.9/site-packages/psutil/_psutil_osx.cpython-39-darwin.so: mach-o, but wrong architecture
Pants version
2.20.x
branch, but applies to older versions too. OS macOS arm64 Additional info This is potentially correlated with the runner disk clearing in #20756 pantsbuild/pants