ubuntu 14.04 安装 pip 出现包依赖问题(This may mean that you have requested an impossible situation or ifyou are using the unstable distribution that some required packages have notyet been created or been moved out of Incoming)
1.错误描述:
Some packages could not be installed. This may meanthat you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
python-pip : Depends: python-pip-whl (= 1.5.4-1ubuntu4) but it is notgoing to be installed
Recommends: build-essential but it is not going to be installed
Recommends: python-dev-all (>= 2.6) but it is not installable
Recommends: python-wheel but it is not installable
E: Unable to correctproblems, you have held broken packages.
2.解决方法
我试了aptitude, 但是没能解决,于是直接用Python命令安装pip,而不是用apt-get安装。
1.去 https://pip.pypa.io/en/stable/installing/#using-linux-package-managers
下载 get-pip.py
2.在放有get-pip.py的目录下打开终端,输入
sudo python get-pip.py
然后应该就可以安装完成了。然后试试命令 pip --version看看是否安装成功。
参考https://pip.pypa.io/en/stable/installing/#using-linux-package-managers
Installation
Do I need to install pip?
pip is alreadyinstalled if you're using Python 2 >=2.7.9 or Python 3 >=3.4binariesdownloaded frompython.org, but you'llneedto upgrade pip.
Additionally, pipwill already be installed if you're working in a VirtualEnvironment created byvirtualenv or pyvenv.
Installing with get-pip.py
To install pip, securely download get-pip.py. [2]
Then run the following:
python get-pip.py
Warning
Be cautious if you'reusing a Python install that's managed by your operatingsystem or anotherpackage manager. get-pip.py does not coordinate withthose tools, and may leaveyour system in an inconsistent state.