GNU/Linux >> Linux の 問題 >  >> Ubuntu

Ubuntu19.04にPythonPipをインストールする方法

このチュートリアルでは、Ubuntu19.04にPythonPipをインストールする方法を示します。知らない人のために、PipコマンドはPythonパッケージをインストールおよび管理するためのツールです。 Python Package Indexにあるものなど。pipを使用すると、特定のバージョンのパッケージをインストールすることもできます。最も重要なのは、pipには、パッケージの完全なリストと対応するバージョン番号を、場合によっては「要件」ファイルを介して管理する機能があることです。 。簡単なインストールと同じ基本的な仕事を実行しますが、いくつかの追加機能があります。

この記事は、少なくともLinuxの基本的な知識があり、シェルの使用方法を知っていること、そして最も重要なこととして、サイトを独自のVPSでホストしていることを前提としています。インストールは非常に簡単で、ルートアカウントで実行されていますが、そうでない場合は、'sudoを追加する必要があります。 ‘ルート権限を取得するコマンドに。 Ubuntu 19.04(Eoan Ermine)サーバーにPipPythonを段階的にインストールする方法を紹介します。

Ubuntu 19.04EoanErmineにPythonPipをインストールする

手順1.まず、ターミナルで次のaptコマンドを実行して、すべてのシステムパッケージが最新であることを確認します。

sudo apt update
sudo apt upgrade

ステップ2.UbuntuにPipPythonをインストールします。

  • Pip for Python 3をインストールするには、次のコマンドを実行します。
sudo apt install python3-pip
  • Python2.7用のPythonPipをインストールするには、次のコマンドを使用します。
sudo apt install python-pip

Python Pipの更新:

pip install -U pip

ステップ3.基本的な使用法pipコマンド。

python-pipパッケージをインストールすると、システムでpipコマンドを使用できるようになります。pipコマンドで使用できるオプションは複数あります。

新しいPythonパッケージタイプをインストールするには:

pip install Package_Names

たとえば、Pipを介してAnsibleをインストールするには、次のコマンドを実行します。

pip install ansible

pip typeでインストールされたPythonパッケージをアンインストールするには:

pip uninstall Package_Names

Pythonパッケージタイプを検索するには:

pip search Package_Names

その他のPipオプションと使用例については、–helpフラグを使用できます:

[[email protected] ~]# pip --help

Usage:   
  pip <command></command> [options]

Commands:
  install                     Install packages.
  uninstall                   Uninstall packages.
  freeze                      Output installed packages in requirements format.
  list                        List installed packages.
  show                        Show information about installed packages.
  search                      Search PyPI for packages.
  wheel                       Build wheels from your requirements.
  zip                         DEPRECATED. Zip individual packages.
  unzip                       DEPRECATED. Unzip individual packages.
  bundle                      DEPRECATED. Create pybundles.
  help                        Show help for commands.

General Options:
  -h, --help                  Show help.
  -v, --verbose               Give more output. Option is additive, and can be used up to 3 times.
  -V, --version               Show version and exit.
  -q, --quiet                 Give less output.
  --log-file            Path to a verbose non-appending log, that only logs failures. This
                              log is active by default at /home/sharad/.pip/pip.log.
  --log                 Path to a verbose appending log. This log is inactive by default.
  --proxy              Specify a proxy in the form [user:passwd@]proxy.server:port.
  --timeout              Set the socket timeout (default 15 seconds).
  --exists-action     Default action when a path already exists: (s)witch, (i)gnore,
                              (w)ipe, (b)ackup.
  --cert                Path to alternate CA bundle.
[[email protected] ~]#

おめでとうございます!Pipが正常にインストールされました。Ubuntu19.04(Eoan Ermine)システムにPip Pythonをインストールするためにこのチュートリアルを使用していただき、ありがとうございます。追加のヘルプや役立つ情報については、公式のPythonを確認することをお勧めします。ウェブサイト。


Ubuntu
  1. Ubuntu18.04にPipをインストールする方法

  2. Ubuntu18.04にPython3.9をインストールする方法

  3. Ubuntu20.04にpipをインストールする方法

  1. Ubuntu18.04または20.04にPython3をインストールする方法

  2. Ubuntu18.04にPython3.7をインストールする方法

  3. Ubuntu18.04にPython3.8をインストールする方法

  1. Ubuntu20.04にPythonPipをインストールする方法

  2. Ubuntu20.04にPython3.9をインストールする方法

  3. Ubuntu18.04および20.04にPythonPipをインストールする方法