How to install pip Python package manager on FreeBSD 12

The
You can download this article in PDF format to support us through the following link.

Download the guide in PDF format

turn off
The

The
The

In this guide, we will study how to install idea Python package manager on FreeBSD 12. pip is a package management system for installing and managing software packages written in Python.

You can install pip on FreeBSD systems in two ways. I installed FreeBSD 12 on my laptop:

# freebsd-version
12.0-RELEASE

FreeBSD 12 comes with Python2.7 and Python3.6.

# python
python2.7         python2.7-config  python3.6         python3.6-config  python3.6m        python3.6m-config

The default version I use is 3.6. Attention python This command is not available on FreeBSD 12.

# which python
python: Command not found

You can create symbolic links to Python3.6 binaries to /usr/local/bin/python

# ln -s /usr/local/bin/python3.6 /usr/local/bin/python
# python --version
Python 3.6.6

Install Pip from py36-pip package:

# pkg install py36-pip
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	py36-pip: 9.0.3
	py36-setuptools: 40.0.0

Number of packages to be installed: 2

The process will require 21 MiB more space.
6 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/2] Fetching py36-pip-9.0.3.txz: 100%    6 MiB 308.7kB/s    00:20    
[2/2] Fetching py36-setuptools-40.0.0.txz: 100%  487 KiB 124.6kB/s    00:04    
Checking integrity... done (0 conflicting)
[1/2] Installing py36-setuptools-40.0.0...
[1/2] Extracting py36-setuptools-40.0.0: 100%
[2/2] Installing py36-pip-9.0.3...
[2/2] Extracting py36-pip-9.0.3: 100%
Message from py36-setuptools-40.0.0:

*******************************************************************

  Only /usr/local/bin/easy_install-3.6 script has been installed
  since Python 3.6 is not the default Python version.

*******************************************************************
Message from py36-pip-9.0.3:

============================== !!!! WARNING !!!! ==========================

pip MUST ONLY be used:

 * With the --user flag, OR
 * To install or manage Python packages in virtual environments

Failure to follow this warning can and will result in an inconsistent
system-wide Python environment (LOCALBASE/lib/pythonX.Y/site-packages) and
cause errors.

Avoid using pip as root unless you know what you're doing.

============================== !!!! WARNING !!!! ==========================

Create a symbolic link for the Pip-3.6 package:

# which pip-3.6
/usr/local/bin/pip-3.6
# ln -s /usr/local/bin/pip-3.6 /usr/local/bin/pip
# pip --version 
pip 9.0.3 from /usr/local/lib/python3.6/site-packages (python 3.6)

Upgrade pip:

# pip install --upgrade pip
Collecting pip
  Downloading https://files.pythonhosted.org/packages/c2/d7/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675cc2ac37/pip-18.1-py2.py3-none-any.whl (1.3MB)
    100% |################################| 1.3MB 750kB/s 
Installing collected packages: pip
  Found existing installation: pip 9.0.3
    Uninstalling pip-9.0.3:
      Successfully uninstalled pip-9.0.3
Successfully installed pip-18.1

Usage of test points

$ pip install awscli --user

If you use Pip as a normal user to install the Python package, place the binary file .local/bin/

Add the path to your PATH variable.

$ vim ~/.bashrc
export PATH=$PATH:.local/bin/

If you want to install Pip for Python 2.7, run:

# pkg install py27-pip

You should now have the PIP Python package manager installed on FreeBSD 12.

Similar articles:

How to install Pip3 and Django on Ubuntu 18.04 / Ubuntu 16.04 LTS

Install Pip on Debian 10 (Buster) Linux

How to install Python 3 / Python 2.7 on RHEL 8

How to install Python 3.6 on Ubuntu 16.04 / CentOS 7 / Debian 9 / macOS

The
You can download this article in PDF format to support us through the following link.

Download the guide in PDF format

turn off
The

The
The

Sidebar