is there a way to prevent the mismatch between
the Homebrew Python and Apple's Python?
The Homebrew Modeller package is designed to work with Homebrew's
Python, i.e. /usr/local/bin/python3 (it will also work with Homebrew's
python@3.8 package, but by default that's not in your path). So if
"import modeller" fails there are are really only 3 possibilities:
1. You are not using Homebrew's Python, i.e. "which python3" does not
print "/usr/local/bin/python3"
or "/usr/local/opt/python@3.8/bin/python3".
2. Something is broken in your Homebrew installation, i.e. "brew doctor"
does not print "Your system is ready to brew."
3. Something is broken elsewhere in your operating system because of you
deleting the Python framework and/or installing multiple versions of Python.