I installed Python3 via brew
:
brew install python@3.9
And following the symlink chain of which python3
leads to:
$ which python3
/usr/local/bin/python3
$ ls -l /usr/local/bin/python3
lrwxr-xr-x 1 user admin 41 27 Jul 17:44 /usr/local/bin/python3 -> ../Cellar/python@3.9/3.9.13_1/bin/python3
$ ls -l /usr/local/Cellar/python\@3.9/3.9.13_1/bin/python3
lrwxr-xr-x 1 user staff 55 23 Jul 08:45 /usr/local/Cellar/python@3.9/3.9.13_1/bin/python3 -> ../Frameworks/Python.framework/Versions/3.9/bin/python3
$ ls -l /usr/local/Cellar/python\@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/bin/python3
lrwxr-xr-x 1 user staff 9 23 Jul 08:44 /usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/bin/python3 -> python3.9
$ ls -l /usr/local/Cellar/python\@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/bin/python3.9
-rwxr-xr-x 1 user staff 13620 23 Jul 08:42 /usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/bin/python3.9
I also installed offlineimap
with:
python3 -m pip install offlineimap
And the shebang line shows:
#!/usr/local/opt/python@3.9/bin/python3.9
which points to a different binary:
$ ls -l /usr/local/opt/python@3.9/bin/python3.9
lrwxr-xr-x 1 user staff 57 23 Jul 08:45 /usr/local/opt/python@3.9/bin/python3.9 -> ../Frameworks/Python.framework/Versions/3.9/bin/python3.9
$ ls -l /usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/bin/python3.9
-rwxr-xr-x 1 user staff 13620 23 Jul 08:42 /usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/bin/python3.9
and the two have the same versions:
$ python3 --version
Python 3.9.13
$ /usr/local/opt/python@3.9/bin/python3.9 --version
Python 3.9.13
How could I have installed two instances of the same Python? How can I uninstall the non-brew version?
/usr/local/opt/python@3.9
is a symlink pointing to../Cellar/python@3.9/3.9.13_1
. Are you sure that in your case it's pointing to a different binary?/usr/local/opt/python@3.9/bin/python3.9
is following the symlink of/usr/local/opt/python@3.9/
two nodes above, right? Can you write an answer?