简体   繁体   中英

Pip not installing in Ubuntu

I gave the command on terminal of Ubuntu 16.04 LTS as-

 $ sudo apt install python-pip

It is giving the error as:

> 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).

How can I install pip? Please see to the errors above.

Okay so to get pip you need to install those missing dependencies. Try the following:

sudo apt-get update

Then

sudo apt-get upgrade

Next try:

sudo apt-get install python-pip

If that doesn't work then try with -f

For more help check this out : https://www.liquidweb.com/kb/how-to-install-pip-on-ubuntu-14-04-lts/

run

sudo apt -f install

Then retry the command, if it still doesn't work, I think you need to install/upgrade some packages in errors

After searching a lot finally this works for me

sudo apt-get install aptitude

Then install pip3 with this command:

sudo aptitude install python3-pip

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM