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

Ubuntu16.04にPipをインストールする方法

このチュートリアルでは、Ubuntu 16.04サーバーにPipをインストールして構成する方法を説明します。知らない人のために、pipコマンドはインストールとPython Package IndexにあるようなPythonパッケージの管理。pipを使用すると、特定のバージョンのパッケージをインストールすることもできます。最も重要なのは、pipには、パッケージの完全なリストと対応するバージョン番号を管理する機能があります。 「requirements」ファイル。easy_installと同じ基本的なジョブを実行しますが、いくつかの追加機能があります。

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

Ubuntu16.04にPipをインストール

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

sudo apt-get update
sudo apt-get upgrade

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

apt-getを使用してpipをインストールします コマンド:

apt-get install python-pip

インストールが完了したら、次のコマンドを使用して、インストールが成功したことを確認できます。

pip -V

ステップ3.pipコマンドの使用方法。

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

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

pip install packageName

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

pip uninstall packageName

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

pip search packageName

その他の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が正常にインストールされました。Ubuntu14.04システムにPip Pythonをインストールするためにこのチュートリアルを使用していただき、ありがとうございます。追加のヘルプや役立つ情報については、Pythonの公式Webサイトを確認することをお勧めします。


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

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

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

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

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

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

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

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

  3. UbuntuにPipをインストールする方法