Mac installs Python environment by downloading Homebrew configuration
1. Install Homebrew
Open a terminal and enter the following command to install Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
2. Update Homebrew
Enter the following command in the terminal:
brew update
3. Install Python
Enter the following command in the terminal to install Python:
brew install python
4. Verify that Python is installed successfully
Enter the following command in the terminal:
python --version
python3 --version
If the version information of Python is output, it means that Python is installed successfully.
5. Install pip
Enter the following command in the terminal to pip install:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python get-pip.py
6. Verify that pip is installed successfully
Enter the following command in the terminal:
pip --version
pip3 --version
If the version information of pip is output, it means that pip is installed successfully.
At this point, the process of installing the Python environment on Mac using Homebrew is complete.