Create an isolated Python environment
Use a native arm64 build of Python that supports your version of MLX. Check your Python version first. If the system doesn't have a suitable interpreter, install a compatible version before creating a virtual environment. These commands won't modify your global Python packages.
python3 --version
mkdir -p ~/mlx-work
cd ~/mlx-work
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install mlx mlx-lm
python -m pip show mlx mlx-lm
Keep a record of your interpreter and package versions. Use the same virtual environment to reproduce experiments, and avoid mixing system Python and project Python across terminals.