As most Mac users, I have two separate versions of python on my machine: The one installed by Apple (version 3.9 in /usr/bin) and one installed via Homebrew (version 3.11 in /opt/homebrew/bin).
I've put the latter first in path and, sure enough,
which python3
prints
/opt/homebrew/bin/python3
and
python3 --version
prints
Python 3.11.6
but Mojo seems to use the other version, as packages installed via pip3 are not accessible.
The following sys_path.🔥
from python import Python
def main():
let sys = Python.import_module("sys")
print(sys.prefix)
prints
/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9
How do I make Mojo use the correct python lib?
PATHlook like inside it?PATHlooks exactly like it is supposed to, everything starting withopt/homebrew/comes first. And, as mentioned above, callingpython3 --versiongives me the right one inside that terminal.opt/then that's the problem right there.