'How to update python 3.6 to 3.7 using Mac terminal

OK I was afraid to use the terminal, so I installed the python-3.7.2-macosx10.9 package downloaded from python.org Ran the certificate and shell profile scripts, everything seems fine. Now the "which python3" has changed the path from 3.6 to the new 3.7.2

So everything seems fine, correct?

My question (of 2) is what's going on with the old python3.6 folder still in the applications folder. Can you just delete it safely? Why when you install a new version does it not at least ask you if you want to update or install and keep both versions?

Second question, how would you do this from the terminal? I see the first step is to sudo to the root. I've forgotten the rest. But from the terminal, would this simply add the new version and leave the older one like the package installer? It's pretty simple to use the package installer and then delete a folder.

So, thanks in advance. I'm new to python and have not much confidence using the terminal and all the powerful shell commands.

And yeah I see all the Brew enthusiasts. I DON'T want to use Brew for the moment.

The python snakes nest of pathways is a little confusing, for the moment. I don't want to get lost with a zillion pathways from Brew because it's confusing for the moment.

I love Brew, leave me alone.



Solution 1:[1]

Yes, you can install Python 3.7 or Python 3.8 using installer that you can download from python.org. It doesn't automatically delete the older version that you can keep using the older version.

For example, if you have python3.7 and python3.8, you can run either one on your terminal.

On the other hand, it is quite easy to install using Homebrew, you can follow the instructions on this article on how to install Python3 on MacOS

Solution 2:[2]

Each version of the Python installation is independent of each other. So its safe to delete the version you don't want, but be cautious of this because it can lead to broken dependencies :-).

You can run any version by adding the specific version i.e $python3.6 or $python3.7

The best approach is to use virtual environments for your projects to enhance consistency. see pipenv

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jun711
Solution 2 Ian