How to Install PIP on macOS
PIP is the default package installer and was recently added to to the core distribution of Python. This means to install PIP we need to install Python. While Python 2 used to come pre-installed in macOS, you should use the newer version, Python 3. The only reason to continue using v2.7 is to support older, existing applications. Luckily, if you’re just getting started, you don’t have any of these. Python installation is a standard .PKG-based affair. To get it up and running, take the following steps:
Examining the Python Install on macOS
The installation contains a few items, as follows:
Two .RTF files: Once contains the License; the other the ReadMe file.Two .COMMAND files: These are there to help perform some configuration. The Install Certificates.command file will set up some SSL certificates, and the Update Shell Profile.command file will help if you have trouble using Python 3, and find that you’re always being directed to Python 2.IDLE app: An integrated development environment specifically for Python.Python Launcher: Helps you to configure some settings related to launching Python scripts.
How to Confirm Python Is Working on macOS
Before you can use Python, it’s best to confirm your Python installation is working correctly.
How to Use Python’s PIP on macOS
We know now Python is working, and we can move on to using PIP. Fortunately, there’s nothing to do here: PIP comes installed out-of-the-box on newer versions of Python. That said, you should familiarize yourself with it. Suppose we want to create our Python application to save passwords. macOS already has a great mechanism for this: Keychain. The following command will show a list of all the packages in PyPI with the keyword “keychain”: