3 Easy Ways to Download & Install Pip on Your Mac
3 Easy Ways to Download & Install Pip on Your Mac
If you want to install packages from the Python Package Index on your Mac, you'll need Pip. Fortunately, if you installed Python 3.4, you should already have Pip—just run the command python3 -m pip --version to check. If you don't have Pip, there are a few different ways to install it. This wikiHow article will walk you through three simple ways to install Pip on a Mac desktop computer or MacBook.
Things You Should Know
  • If you installed Python 3.4 or later, you should have Pip. If the pip command is not working, use pip3 instead.
  • If Pip isn't installed, you can install it using the command python3 -m ensurepip --default-pip.
  • If you didn't use Homebrew or another package manger to install Python, you can install Pip with the Get-Pip Python script.

Installing with Ensurepip

Open a Terminal window. If you haven't done so, you can open a Terminal from the Launchpad. The Ensurepip Python module is the most straightforward way to install Pip on both macOS and Linux.

Check to see if Pip is already installed. If you installed Python 3.9 or later from Python.org, by using Homebrew, or by installing the Xcode command line tools, you should already have Pip. To check, type python3 -m pip --version into your terminal and press Return. If pip3 is not found, continue with this method to install it. If needed, you can update Pip to the latest version using the command python -m pip install --upgrade pip.

Type python3 -m ensurepip --default-pip and press ⏎ Return. If Pip was not installed, this command will install it to your current Python 3 installation. If Pip was installed, you'll see a message that says "Requirement already satisfied." If you only want to install Pip for the current user (not machine-wide), use the command python3 -m ensurepip --upgrade --user instead.

Installing with Homebrew

Open a Terminal window. If you installed Python 3.4 or later using Homebrew, you will already have Pip installed. If you don't have Python 3.4, you can install it easily with Homebrew, which will give you the latest version of Pip. If you want to upgrade the version of Pip you installed with Homebrew, use the command python3 -m pip install --upgrade pip. To see which version of Pip is installed, use the command python3 -m pip --version.

Install Homebrew. If you haven’t already installed Homebrew, type /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" and press Return.

Install Python3 and Pip. Installing Python also installs Pip. To install, type brew install python3 and press Return.

Installing with Get-Pip

Open a Terminal window. If you installed Python from source code but don't have Pip, you can use a simple script to install it. Don't use this method if you installed Python through Homebrew or another package manager, as the script will not interact with those tools. You can check your current Pip version using the command python3 -m pip --version. Or, if you just want to update Pip, use the command python3 -m pip install --upgrade pip.

Download the script. You can use the curl command to do this. Just type curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py and press Return to save the script to the current directory.

Type python3 get-pip.py and press ⏎ Return. This runs the downloaded script, which will then install Pip, SetupTools, and Wheel for your current Python 3 environment.

What's your reaction?

Comments

https://popochek.com/assets/images/user-avatar-s.jpg

0 comment

Write the first comment for this!