无法安装Pip3,无法安装setuptools

时间:2019-06-14 04:48:23

标签: python-3.x ubuntu python-3.6

我正在尝试在ubantu18.04上安装pip3,但出现错误:

bhagyashree@Lenovo:~$ sudo apt-get install python3-setuptools
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that 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:
 python3-setuptools : Depends: python3-pkg-resources (= 20.7.0-1) but 39.0.1-2 is to be installed
E: Unable to correct problems, you have held broken packages.

bhagyashree@Lenovo:~$ pip3
Traceback (most recent call last):
  File "/usr/bin/pip3", line 9, in <module>
    from pip import main
  File "/usr/lib/python3/dist-packages/pip/__init__.py", line 26, in <module>
    from pip.utils import get_installed_distributions, get_prog
  File "/usr/lib/python3/dist-packages/pip/utils/__init__.py", line 23, in <module>
    from pip.locations import (
  File "/usr/lib/python3/dist-packages/pip/locations.py", line 9, in <module>
    from distutils import sysconfig
ImportError: cannot import name 'sysconfig'

I also tried
bhagyashree@Lenovo:~$ sudo apt install python3-distutils
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package python3-distutils is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  libpython3.6-stdlib libpython3.7-stdlib:i386 libpython3.7-stdlib
E: Package 'python3-distutils' has no installation candidate

bhagyashree@Lenovo:~$ sudo apt-get install zlib1g-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that 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:
 zlib1g-dev : Depends: zlib1g (= 1:1.2.8.dfsg-2ubuntu4.1) but 1:1.2.11.dfsg-0ubuntu2 is to be installed
E: Unable to correct problems, you have held broken packages.

请帮助我。

0 个答案:

没有答案