pip
安裝pip
sudo apt-get install python-pip
更新pip
pip install --upgrade pip
更新某個庫
pip install --upgrade ...
pip install ... --upgrade
pip install protobuf==3.0.0
更新所有庫
pip freeze --local | cut -d = -f 1 | xargs pip install -U
臨時鏡像
pip install -i https://pypi.anaconda.org/pypi/simple ...
or
pip install -i https://pypi.doubanio.com/simple/ ...
永久鏡像
sudo mkdir /root/.pip
sudo gedit /root/.pip/pip.conf
添加內(nèi)容
[global] trusted-host=pypi.douban.com
index-url=http://pypi.douban.com/simple
Problem & Solution:
Problem_0
Failed To Download Repository Information" error:
Solution_0
sudo rm -rf /var/lib/apt/lists/*
sudo apt-get update
Problem_1
安裝 ipython 時
python setup.py egg_info的錯誤
Solution_1
pip uninstall certifi
pip install certifi==2015.11.20
pip install --upgrade distribute
Problem_2
pip不能正常工作
Solution_2
sudo apt-get install python python-dev libatlas-base-dev gcc gfortran g++
或者
使用 chown & chmod 來修改Python的 authority
Problem_3
如果
sudo apt-get python-pip
不能正常工作
Solution_3
試一下:
sudo aptitude install python-pip
遇到選項(xiàng)時按以下順序選擇:
n --> y --> y