Category Archives: python

Installing Python package manager pip on FreeBSD

UPDATE: You can now install pip using pkg.

[cmp@server ~]# pkg install py27-pip
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        py27-pip: 9.0.1

Number of packages to be installed: 1

The process will require 13 MiB more space.
2 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/1] Fetching py27-pip-9.0.1.txz: 100%    2 MiB 858.8kB/s    00:03    
Checking integrity... done (0 conflicting)
[1/1] Installing py27-pip-9.0.1...
Extracting py27-pip-9.0.1: 100%


Original post
Somewhat strangely, pip is not installed when you install Python using FreeBSD’s pkg. However, there’s a very simple fix.

[cmp@server ~]# python -m ensurepip
Ignoring indexes:
Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/local/lib/python2.7/site-packages
Collecting pip
Installing collected packages: pip
Successfully installed pip-7.1.2

[cmp@server ~]# pip
pip     pip2    pip2.7