root@:/my_soft # freebsd-version
12.0-RELEASE-p3
root@:/my_soft # python -V
Python 3.6.8
root@:/my_soft # pkg search py36-pip
py36-pip-19.1.1 Tool for installing and managing Python packages
py36-pip-api-0.0.11 Importable pip API
py36-pip-tools-3.8.0 Keep your pinned dependencies fresh
py36-pip-tools2-2.0.2 Keep your pinned dependencies fresh
py36-pipdeptree-0.13.2 Command line utility to show dependency tree of packages
py36-pipenv-2018.11.26_1 Python Development Workflow for Humans
root@:/my_soft # 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: 19.1.1
py36-setuptools: 41.0.1
Number of packages to be installed: 2
The process will require 15 MiB more space.
2 MiB to be downloaded.
Proceed with this action? [y/N]: y
[1/2] Fetching py36-pip-19.1.1.txz: 100% 2 MiB 930.6kB/s 00:02
[2/2] Fetching py36-setuptools-41.0.1.txz: 100% 498 KiB 34.0kB/s 00:15
Checking integrity... done (0 conflicting)
[1/2] Installing py36-setuptools-41.0.1...
[1/2] Extracting py36-setuptools-41.0.1: 100%
[2/2] Installing py36-pip-19.1.1...
[2/2] Extracting py36-pip-19.1.1: 100%
Message from py36-pip-19.1.1:
============================== !!!! 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 !!!! ==========================
root@:/my_soft # pip -V
pip 19.1.1 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)
运行pip list命令就可以看到已安装的包和版本号。.
总结就几条命令:
root@:/my_soft # freebsd-version
root@:/my_soft # python -V
root@:/my_soft # pkg search py36-pip
root@:/my_soft # pkg install py36-pip
root@:/my_soft # pip -V
root@:/my_soft # pip list