Python3 command not found - Mac
How to Install Python3 Command on Mac
If you are using a Mac and trying to run Python 3 but encounter the “python3 command not found” error, don’t worry. This tutorial will guide you through the process of installing Python 3 on your Mac.
Why Python3 Command is Not Found?
Starting with macOS Catalina, Python 2 is no longer included by default. This means that if you try to run python3 on a fresh installation of macOS, you may encounter the “command not found” error.
Installation Steps
Step 1: Check Python Version
Before installing Python 3, check if it is already installed on your Mac by running the following command in your terminal:
python3 --version
If Python 3 is not installed, you will see the “command not found” error.
Step 2: Install Homebrew
Homebrew is a package manager for macOS that makes it easy to install and manage software packages. If you don’t have Homebrew installed, you can do so by running the following command in your terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Step 3: Install Python 3 using Homebrew
Once Homebrew is installed, you can use it to install Python 3 by running the following command:
brew install python
This command will install Python 3 on your Mac.
Step 4: Verify Python Installation
After the installation is complete, you can verify that Python 3 is installed by running:
python3 --version
You should see the version of Python 3 installed on your system.
Conclusion
By following these steps, you should now have Python 3 installed on your Mac and be able to run the python3 command without encountering the “command not found” error. Python 3 is a powerful programming language that is widely used for various applications, so having it installed on your system can be very beneficial for your development projects.