Linux

在 debain 上安裝 PIP - 未知命令 pip

  • November 23, 2013

我在 debian linux 機器上安裝 PIP 有點困難。這是我在 shell 腳本中使用的程式碼:

# Install setuptools
python -c 'import setuptools' > /dev/null 2>&1
if [[ $? != 0 ]] ; then
   wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | sudo python
   if [[ $? != 0 ]] ; then
       echo "Unable to install setuptools" >> /dev/stderr
#       exit 1
   fi
fi

# Install PIP
wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
python get-pip.py

# Install packages
pip install supervisor --pre
pip install uwsgi 
pip install virtualenv

但是在我的日誌中,我收到以下消息,表明 PIP 沒有正確安裝:

/root/StackScript: line 42: pip: command not found
/root/StackScript: line 43: pip: command not found
/root/StackScript: line 44: pip: command not found

誰能幫我理解我哪裡出錯了?

只需從儲存庫安裝包 python-pip:

apt-get install python-pip

如果您確實需要最新版本,那麼要從命令行使用它,您應該將其可執行目錄添加到 $PATH

引用自:https://serverfault.com/questions/557010