On a vanilla MacBook with M1 processor, I installed MacVim via Homebrew:
brew install --cask macvim
However, when running :python import sys; print(sys.version)
inside MacVim, I get:
E370: Could not load library /System/Library/Frameworks/Python.framework/Versions/2.7/Python: dlopen(/System/Library/Frameworks/Python.framework/Versions/2.7/Python, 0x0009): tried: '/System/Library/Frameworks/Python.framework/Versions/2.7/Python' (no such file), '/Library/Frameworks/Python.framework/Versions/2.7/Python' (no such file)
E263: Sorry, this command is disabled, the Python library could not be loaded.
I strangely can't find the right instructions based on the above error message, as I expect this problem to be quite common.
The cause is that macOS no longer ships with Python, but fixing it is not trivial. It seems that I'll need the right combination of a specific Python installation (Homebrew?) and the correct Vim configuration.
Does anyone know the exact setup and configuration instructions?