サクラのレンタルサーバーにpipをインストール

サクラのレンタルサーバー

pipのインストール

sakuraのレンタルサーバー(スタンダート)にpipをインストールします。

Pythonのバージョンを調べる

% python --version
Python 2.7.16

以下のコマンドでディレクトリを作成

mkdir -p ~/.local/lib/python2.7/site-packages

pipのインストール

以下のコマンドでpipのインストール

easy_install --prefix=~/.local pip

以下のように、問題なくインストールが終了します。


Searching for pip
Reading https://pypi.org/simple/pip/
Downloading https://files.pythonhosted.org/packages/ ~省略 ~
Best match: pip 20.0.2
Processing pip-20.0.2-py2.py3-none-any.whl
Installing pip-20.0.2-py2.py3-none-any.whl to /home/hogehoge/.local/lib/python2.7/site-packages
Adding pip 20.0.2 to easy-install.pth file
Installing pip script to /home/hogehoge/.local/bin
Installing pip3.8 script to /home/hogehoge/.local/bin
Installing pip3 script to /home/hogehoge/.local/bin

Installed /home/hogehoge/.local/lib/python2.7/site-packages/pip-20.0.2-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip

pipのパスの追加

.bashrcの最終行に以下を追記

export PATH=$PATH:~/.local/bin

パスの追加を反映させるため、以下のコマンドを実行します。以下のコマンドは、次回のログインからは不要です。

source .bashrc

pipのインストール確認

pipのバージョンは、以下のコマンドで確認できます。

[hogehogewww0000 ~]$ pip --version
pip 20.0.2 from /home/hogehoge/.local/lib/python2.7/site-packages/pip-20.0.2-py2.7.egg/pip (python 2.7)
[hogehoge@www0000 ~]$

スポンサーリンク
サクラのレンタルサーバー
Engineerをフォローする
レンサバ