I used to use Python 3.10.4 but I installed Python 3.8.9, Python 3.8.10 to use GPU on my 2019 MBP (Mac OS Monterey 12.4) but it did not work.
So I tried to uninstall all of my old versions of Python (3.8.9 and 3.8.10) but when I go to VSCode and select kernel for my new Jupyter Notebook file, the list shows Python 3.8.9 and 3.10.4.
And when I go to my Terminal app and I do not find 3.8.9.
Can you help me with this problem showing old version of Python?
CodePudding user response:
From my limited experience with mac os, it's possible that when you uninstalled Python you didn't change it's PATH so when you call Python, you call a legacy version.
As stated in this guide.
which python
will show you the path of your installed python. Copy it.sudo nano /etc/paths
will ask you for the password and open a text editor copy the Python path in it.
try it
CodePudding user response:
The python stored inside /usr/local/bin
is a python installed by you, and it may be removed or updated.
In other side, python stored in /usr/bin
is a default python that comes with macOS from beginning (you didn't install it)
macOS trying to use default (protected from changes) version when running some python dependable system applications. If you remove default version, that may break some OS features.
It is possible to remove default applications inside /usr/bin
after turning off SIP, but I don't recommend to do that