
Centos7 Docker コンテナに python-pip をインストールしようとしていますが、何らかのパッケージが不足しているのではないかと思います。
[root@aasdfasdfa /]# yum -y install python-pip
Loaded plugins: fastestmirror, ovl
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
updates/7/x86_64/primary_db | 8.4 MB 00:00:31
Loading mirror speeds from cached hostfile
* base: repos.lax.quadranet.com
* extras: mirrors.unifiedlayer.com
* updates: mirrors.usc.edu
No package python-pip available.
Error: Nothing to do
yum -y install python-pip
正しくインストールするには、事前に何を実行する必要がありますか。これeasy_install
も壊れているため、オプションではないことに注意してください。
答え1
EPEL リポジトリを有効にする必要があります。以下を使用します。
yum --enablerepo=extras install epel-release
このコマンドは、実行中の CentOS バージョンに適した EPEL リポジトリをインストールします。
その後、python-pip をインストールできるようになります。
答え2
私も同じ問題で頭がおかしくなりそうでした。yum が python-pip を見つけられなかった理由は、それがもう python-pip という名前ではなくなったからです。EPEL バージョン 7 以降では、python のバージョンを識別するために名前が変更されました。私の CentOS マシンでは、次の python*-pip パッケージが見つかります。
[root@asdasdasdasdsa ~]# yum info python*-pip
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.rz.uni-frankfurt.de
* epel: mirrors.mit.edu
* extras: mirror.23media.de
* updates: ftp.plusline.de
Available Packages
Name : python2-pip
Arch : noarch
Version : 8.1.2
Release : 5.el7
Size : 1.7 M
Repo : epel/x86_64
Summary : A tool for installing and managing Python 2 packages
URL : http://www.pip-installer.org
License : MIT
Description : Pip is a replacement for `easy_install
: <http://peak.telecommunity.com/DevCenter/EasyInstall>`_. It uses mostly the
: same techniques for finding packages, so packages that were made
: easy_installable should be pip-installable as well.
Name : python34-pip
Arch : noarch
Version : 8.1.2
Release : 5.el7
Size : 1.7 M
Repo : epel/x86_64
Summary : A tool for installing and managing Python3 packages
URL : http://www.pip-installer.org
License : MIT
Description : Pip is a replacement for `easy_install
: <http://peak.telecommunity.com/DevCenter/EasyInstall>`_. It uses mostly the
: same techniques for finding packages, so packages that were made
: easy_installable should be pip-installable as well.
答え3
CentOS Docker イメージには、通常の CentOS インストールとは異なり、デフォルトでは EPEL リポジトリが含まれていません。yum install epel-release
まず、これを実行する必要があり、その後はyum install python-pip
動作するはずです。
答え4
epel リポジトリをインストールした後でも同じエラーが発生する場合は、次を試してください。
sudo yum install -y --enablerepo="epel" python-pip