点不在Ubuntu中安装

时间:2017-06-07 08:30:19

标签: python linux ubuntu pip

我在Ubuntu 16.04 LTS终端上发出命令为 -

 $ sudo apt install python-pip

它给出的错误为:

> Reading package lists... Done Building dependency tree        Reading
> state information... Done You might want to run 'apt-get -f install'
> to correct these: The following packages have unmet dependencies: 
> bcmwl-kernel-source:i386 : Depends: dkms:i386
>                             Depends: linux-libc-dev:i386 but it is not going to be installed
>                             Depends: libc6-dev:i386 but it is not going to be installed
>                             Depends: linux-headers-generic:i386 but it is not going to be installed or
>                                      linux-headers:i386  dkms : Depends: module-init-tools but it is not going to be installed 
> python-pip : Depends: python-pip-whl (= 8.1.1-2ubuntu0.4) but it is
> not going to be installed
>               Recommends: python-all-dev (>= 2.6) but it is not going to be installed
>               Recommends: python-setuptools but it is not going to be installed
>               Recommends: python-wheel but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no
> packages (or specify a solution).

我该如何安装pip?请查看上面的错误。

3 个答案:

答案 0 :(得分:3)

好的,所以要获得pip,你需要安装那些缺少的依赖项。请尝试以下方法:

sudo apt-get update

然后

sudo apt-get upgrade

接下来尝试:

sudo apt-get install python-pip

如果不起作用,请尝试使用-f

如需更多帮助,请查看以下内容:https://www.liquidweb.com/kb/how-to-install-pip-on-ubuntu-14-04-lts/

答案 1 :(得分:1)

运行

sudo apt -f install

然后重试命令,如果它仍然不起作用,我认为你需要install/upgrade一些错误的包

答案 2 :(得分:1)

经过大量搜索后,这最终对我有用

sudo apt-get install aptitude

然后使用以下命令安装pip3:

sudo aptitude install python3-pip