Installing or downloading Python 3 isn’t the easiest task to do on macOS. Also, it’s not that hard as you think but you must know what conditions you’re working with. Don’t fret come let’s check Python 3 Installation On macOS.
Requirements
Well, it is for macOS Catalina. Make sure that macOS comes built-in in Python but on Catalina, this is version 2.7 which arrived at the end of its life. This will also make a few hiccups in an entire process but let’s begin with the basics.
Initially, download Xcode on your Mac. You can get it after visiting the Mac App Store. Once you installed, remember that the app is running. Now, launch it to ensure there isn’t an issue.
Secondly, open Terminal and execute the following command. It installs Command Line Tools for Xcode. You want these to download Homebrew. The whole process is quite easy and simple. Just follow the on-screen prompts or instructions.
xcode-select –install
At last, execute the following command in Terminal to install Homebrew
/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
Note: link is also the part of the command
Python 3 Installation On macOS
Now that you’ve successfully installed the basic apps you want, you can download Python 3. Now, head over to a new Terminal window, and execute the following command.
brew install python3
The installation can’t take too much time. But you might want to authenticate with your user password during the whole installation process. Once it ends, you will view a message saying that Python 3 was installed. Now you want to install pip.
pip is the python package manager. When you install or download Python scripts or apps, you might view ‘pip’ at the beginning of the install command. If you want to install pip, execute the following command in Terminal.
brew postinstall python3
Probably the command not work. If you view the ‘setup.py –no-user-cfg install ‘ message in Terminal. Then it means that pip can’t install. If the situation occurs, just execute this command rather than and it will install pip.
sudo easy_install pip
Python 2 vs Python 3
Well, Python 2 is still on your PC even though you’ve installed Python 3. If you want to share commands to Python 3, simply input python3 in the terminal. If you input python, the command will be sent to Python 2.
Supposing you’ve now installed Python 3, then you can check it by executing the following command in Terminal.
python3 –version
Make sure that we input python3 and not python. If you input python –version, then you will get various version number i.e., the Python 2 version. In that case, we don’t suggest erasing Python 2 from macOS as there are still a few loops that Python 3 and pip have on the Mac platform. Also, it’s the best idea to have the old version to fall back on.
Conclusion:
Here’s all about “Python 3 Installation On macOS”. Have you ever deal with python 3 installation? Do you face any difficulty while installing python 3? Share your thoughts with us. For further queries and questions let us know in the comment section below!
Till then! Peace Out ?
Also Read: