先日
★CentOS 7系列にgit 2系列をインストールする【2023年4月】(2023年04月11日 (火曜日))
な作業をしました。
Pythonを使った環境でテストしてみたいのがありまして、そのプログラムのテストにはpipが必要な模様。Python自体は
Python 2.7.5
でございます。
で今度はpipを入れてみよう、という事で
sudo yum install python-pip
でいいのかな?とググると
★CentOS7にpipをインストールする - プログラマーの調べ物
★CentOS 7にpipをインストールする方法 - アンドロイド 2023
ただ
sudo yum install python-pip
だけではいかないようだ。
例の如くサードパーティリポジトリが必要との事。
という事でEPELリポジトリをインストールします。
sudo yum install epel-release
とすると
読み込んだプラグイン:fastestmirror, product-id, search-disabled-repos, subscription-
: managerThis system is not registered with an entitlement server. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
* base: ftp.iij.ad.jp
* epel: ftp.riken.jp
* extras: ftp.iij.ad.jp
* updates: ftp.iij.ad.jp
パッケージ epel-release-7-14.noarch はインストール済みか最新バージョンです
何もしません
という事で
sudo yum install python-pip
とすると
読み込んだプラグイン:fastestmirror, product-id, search-disabled-repos, subscription-
: managerThis system is not registered with an entitlement server. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
* base: ftp-srv2.kddilabs.jp
* epel: ftp.riken.jp
* extras: ftp-srv2.kddilabs.jp
* updates: ftp-srv2.kddilabs.jp
依存性の解決をしています
--> トランザクションの確認を実行しています。
---> パッケージ python2-pip.noarch 0:8.1.2-14.el7 を インストール
--> 依存性解決を終了しました。依存性を解決しました
================================================================================
Package アーキテクチャー
バージョン リポジトリー 容量
================================================================================
インストール中:
python2-pip noarch 8.1.2-14.el7 epel 1.7 Mトランザクションの要約
================================================================================
インストール 1 パッケージ総ダウンロード容量: 1.7 M
インストール容量: 7.2 M
Is this ok [y/d/N]: y
Downloading packages:
警告: /var/cache/yum/x86_64/7/epel/packages/python2-pip-8.1.2-14.el7.noarch.rpm: ヘッダー V4 RSA/SHA256 Signature、鍵 ID 352c64e5: NOKEY
python2-pip-8.1.2-14.el7.noarch.rpm の公開鍵がインストールされていません
python2-pip-8.1.2-14.el7.noarch.rpm | 1.7 MB 00:00
file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 から鍵を取得中です。
Importing GPG key 0x352C64E5:
Userid : "Fedora EPEL (7)"
Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
Package : epel-release-7-14.noarch (@/epel-release-latest-7.noarch)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
上記の処理を行います。よろしいでしょうか? [y/N]y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
インストール中 : python2-pip-8.1.2-14.el7.noarch 1/1
検証中 : python2-pip-8.1.2-14.el7.noarch 1/1インストール:
python2-pip.noarch 0:8.1.2-14.el7完了しました!
pip -V
とすると
pip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7)
の表示、インストール完了です。
テストしてみたいのは
★ChatGPTを使って自分のはてなブログとチャットするツールを作った - $shibayu36->blog;
なのですが・・・・・・gitとpip入れてて思ったけど、
★Intel Mac(x86)のmacOS 12のVirtualBOX(仮想環境)でLinux(CentOS 7)のインストールからサーバー環境構築(2022年11月08日 (火曜日))
この環境にgitとpip入れなくてもテストできればいいのだからDockerでよかったのでは・・・・・
実際にこのスクリプト試してみたら
pip install -r requirements.txt
エラーが出た上に
You are using pip version 8.1.2, however version 23.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
比較的新しいPythonが標準で入ってそうなmacの方でやってみるか、と一瞬思ったけど
★macOS 12.3 MontereyではPythonのランタイムが削除され、依存したアプリや機能拡張が動かなくなるので注意を。
そうでした・・・・実際MacのターミナルでPython使おうとしたら
xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.
Windows 11のWSL
★HP Pavilion Aero 13-be1000(Windows 11 Pro)にWSL2とDocker Desktop(Ver 4.16.2) をインストールしてみた(2023年01月25日 (水曜日))
の方はpython3 -V
Python 3.10.6
でpip -Vでは
Command 'pip' not found, but can be installed with:
sudo apt install python3-pip
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package python3-pip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another sourceE: Package 'python3-pip' has no installation candidate
やっぱり、あとでDockerでやってみよう・・・・・・