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

CentOS / Debian/UbuntuにPythonpipをインストールする方法

Pipは、Pythonで記述されたソフトウェアパッケージをインストールおよび管理するために使用されるパッケージ管理システムです。多くのパッケージは、Python Package Index(PyPI)にあります。 Python 2.7.9以降(python2シリーズ)およびPython 3.4以降にはデフォルトでpip(Python 3の場合はpip3)が含まれているため、すでにpipを使用している可能性があります。

OSパッケージマネージャーの使用

Linuxでは、以下に示すように、システムパッケージマネージャーを使用してpipをインストールできます。

Debian / Ubuntuの場合:

[root@openstack export]# apt-get install python-pip

Fedora / CentOS / RHELの場合:

[root@openstack export]# yum install python-pip

上記のコマンドが機能しない場合は、PIPを手動でインストールできます

PIPのインストール

[root@openstack export]# wget https://bootstrap.pypa.io/get-pip.py --no-check-certificate

次のコマンドを実行します:

[root@openstack export]# python get-pip.py

get-pip.py setuptoolsをインストールします まだインストールされていない場合は、あなたにも。

これで、pipパッケージマネージャーが正常にインストールされました。

Note: In case, if 'python get-pip.py' ended up with "Syntax Error at line 43", then you need to check the version of Python. Pip is not supported in Python version 2.4, you may need to install Python version > 2.4. Here's a guide that explains Installation of Python version 3.5 from source.

pipをアップグレードする方法

LinuxまたはOSXの場合:以下のコマンドを実行します。

[root@openstack export]# pip install -U pip
/usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Requirement already up-to-date: pip in /usr/lib/python2.6/site-packages

Ubuntu
  1. Ubuntu 18.04、Debian 9、LinuxMint19にPipをインストールする方法

  2. Ubuntu、Debian、LinuxmintにPython3.5をインストールする方法

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

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

  2. Debian9にPIPをインストールする方法

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

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

  2. CentOS8にPipをインストールする方法

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