Wednesday, August 2, 2023

pip install for specific architecture

 On a Mac M1, I was getting this error message when attempting to run ingest.py

ImportError: dlopen(/Users/.../lib/python3.10/site-packages/hnswlib.cpython-310-darwin.so, 0x0002): tried: '/Users/.../lib/python3.10/site-packages/hnswlib.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/.../lib/python3.10/site-packages/hnswlib.cpython-310-darwin.so' (no such file), '/Users/.../lib/python3.10/site-packages/hnswlib.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))

Below steps was taken to resolve the issue

# 1. Uninstall hnswlib

> pip uninstall hnswlib


# 2. Clear the pip cache

> pip cache purge


# 3. Reinstall with the arm64 architecture

> ARCHFLAGS="-arch arm64" pip install hnswlib


No comments:

Post a Comment