Debian8 下我想安装个 python3 的 pip,系统自带了 python3.4.2,然后就是各种报错,试了网上的各种方法,就是不行,不过 pip list 能显示一半,然后就是报错。显示如下:
root@debian:~# python3
get-pip.pyException:
Traceback (most recent call last):
File "/tmp/tmp54idda2a/pip.zip/pip/_internal/
basecommand.py", line 228, in main
status =
self.run(options, args)
File "/tmp/tmp54idda2a/pip.zip/pip/_internal/commands/
install.py", line 241, in run
with self._build_session(options) as session:
File "/tmp/tmp54idda2a/pip.zip/pip/_internal/
basecommand.py", line 81, in _build_session
insecure_hosts=options.trusted_hosts,
File "/tmp/tmp54idda2a/pip.zip/pip/_internal/
download.py", line 338, in __init__
self.headers["User-Agent"] = user_agent()
File "/tmp/tmp54idda2a/pip.zip/pip/_internal/
download.py", line 101, in user_agent
zip(["name", "version", "id"], distro.linux_distribution()),
File "/tmp/tmp54idda2a/pip.zip/pip/_vendor/
distro.py", line 120, in linux_distribution
return _distro.linux_distribution(full_distribution_name)
File "/tmp/tmp54idda2a/pip.zip/pip/_vendor/
distro.py", line 634, in linux_distribution
self.version(),
File "/tmp/tmp54idda2a/pip.zip/pip/_vendor/
distro.py", line 688, in version
self.lsb_release_attr('release'),
File "/tmp/tmp54idda2a/pip.zip/pip/_vendor/
distro.py", line 836, in lsb_release_attr
return self._lsb_release_info.get(attribute, '')
File "/tmp/tmp54idda2a/pip.zip/pip/_vendor/
distro.py", line 522, in __get__
ret = obj.__dict__[self._fname] = self._f(obj)
File "/tmp/tmp54idda2a/pip.zip/pip/_vendor/
distro.py", line 933, in _lsb_release_info
stdout = subprocess.check_output(cmd, stderr=devnull)
File "/usr/lib/python3.4/
subprocess.py", line 620, in check_output
raise CalledProcessError(retcode, process.args, output=output)
subprocess.CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit status 1
Traceback (most recent call last):
File "
get-pip.py", line 20649, in <module>
main()
File "
get-pip.py", line 197, in main
bootstrap(tmpdir=tmpdir)
File "
get-pip.py", line 175, in bootstrap
sys.exit(pip._internal.main(args))
File "/tmp/tmp54idda2a/pip.zip/pip/_internal/
__init__.py", line 246, in main
File "/tmp/tmp54idda2a/pip.zip/pip/_internal/
basecommand.py", line 264, in main
File "/tmp/tmp54idda2a/pip.zip/pip/_internal/
basecommand.py", line 81, in _build_session
File "/tmp/tmp54idda2a/pip.zip/pip/_internal/
download.py", line 338, in __init__
File "/tmp/tmp54idda2a/pip.zip/pip/_internal/
download.py", line 101, in user_agent
File "/tmp/tmp54idda2a/pip.zip/pip/_vendor/
distro.py", line 120, in linux_distribution
File "/tmp/tmp54idda2a/pip.zip/pip/_vendor/
distro.py", line 634, in linux_distribution
File "/tmp/tmp54idda2a/pip.zip/pip/_vendor/
distro.py", line 688, in version
File "/tmp/tmp54idda2a/pip.zip/pip/_vendor/
distro.py", line 836, in lsb_release_attr
File "/tmp/tmp54idda2a/pip.zip/pip/_vendor/
distro.py", line 522, in __get__
File "/tmp/tmp54idda2a/pip.zip/pip/_vendor/
distro.py", line 933, in _lsb_release_info
File "/usr/lib/python3.4/
subprocess.py", line 620, in check_output
raise CalledProcessError(retcode, process.args, output=output)
subprocess.CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit status 1
root@debian:~# apt-get install python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-pip is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 110 not upgraded.
17 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Traceback (most recent call last):
File "/usr/bin/apt-listchanges", line 28, in <module>
import apt_pkg
ImportError: No module named 'apt_pkg'
Setting up python-apt (0.9.3.12) ...
Traceback (most recent call last):
File "/usr/bin/pycompile", line 35, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
File "/usr/share/python/debpython/
version.py", line 24, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package python-apt (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of apt-listchanges:
apt-listchanges depends on python-apt (>= 0.7.93); however:
Package python-apt is not configured yet.
dpkg: error processing package apt-listchanges (--configure):
dependency problems - leaving unconfigured
Setting up python-ply (3.4-5) ...
Traceback (most recent call last):
File "/usr/bin/pycompile", line 35, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
File "/usr/share/python/debpython/
version.py", line 24, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package python-ply (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of python-pycparser:
python-pycparser depends on python-ply (>= 3.2); however:
Package python-ply is not configured yet.
python-pycparser depends on python-ply (<< 3.5) | python-ply-yacc-3.2; however:
Package python-ply is not configured yet.
Package python-ply-yacc-3.2 is not installed.
Package python-ply which provides python-ply-yacc-3.2 is not configured yet.
python-pycparser depends on python-ply-lex-3.2; however:
Package python-ply-lex-3.2 is not installed.
Package python-ply which provides python-ply-lex-3.2 is not configured yet.
dpkg: error processing package python-pycparser (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-cffi:
python-cffi depends on python-pycparser; however:
Package python-pycparser is not configured yet.
dpkg: error processing package python-cffi (--configure):
dependency problems - leaving unconfigured
Setting up python-colorama (0.3.2-1) ...
Traceback (most recent call last):
File "/usr/bin/pycompile", line 35, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
File "/usr/share/python/debpython/
version.py", line 24, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package python-colorama (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of python-cryptography:
python-cryptography depends on python-cffi; however:
Package python-cffi is not configured yet.
dpkg: error processing package python-cryptography (--configure):
dependency problems - leaving unconfigured
Setting up python-distlib (0.1.9-1) ...
Traceback (most recent call last):
File "/usr/bin/pycompile", line 35, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
File "/usr/share/python/debpython/
version.py", line 24, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package python-distlib (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up python-html5lib (0.999-3) ...
Traceback (most recent call last):
File "/usr/bin/pycompile", line 35, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
File "/usr/share/python/debpython/
version.py", line 24, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package python-html5lib (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of python-openssl:
python-openssl depends on python-cryptography; however:
Package python-cryptography is not configured yet.
dpkg: error processing package python-openssl (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-ndg-httpsclient:
python-ndg-httpsclient depends on python-openssl; however:
Package python-openssl is not configured yet.
dpkg: error processing package python-ndg-httpsclient (--configure):
dependency problems - leaving unconfigured
Setting up python-urllib3 (1.16-1+deb8u1) ...
Traceback (most recent call last):
File "/usr/bin/pycompile", line 35, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
File "/usr/share/python/debpython/
version.py", line 24, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package python-urllib3 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of python-requests:
python-requests depends on python-urllib3 (>= 1.16); however:
Package python-urllib3 is not configured yet.
python-requests depends on python-urllib3 (<< 1.16.1); however:
Package python-urllib3 is not configured yet.
dpkg: error processing package python-requests (--configure):
dependency problems - leaving unconfigured
Setting up python-setuptools (5.5.1-1) ...
Traceback (most recent call last):
File "/usr/bin/pycompile", line 35, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
File "/usr/share/python/debpython/
version.py", line 24, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package python-setuptools (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of python-pip:
python-pip depends on python-colorama; however:
Package python-colorama is not configured yet.
python-pip depends on python-distlib; however:
Package python-distlib is not configured yet.
python-pip depends on python-html5lib; however:
Package python-html5lib is not configured yet.
python-pip depends on python-requests; however:
Package python-requests is not configured yet.
python-pip depends on python-setuptools (>= 0.6c1); however:
Package python-setuptools is not configured yet.
dpkg: error processing package python-pip (--configure):
dependency problems - leaving unconfigured
Setting up python-pyasn1 (0.1.7-1) ...
Traceback (most recent call last):
File "/usr/bin/pycompile", line 35, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
File "/usr/share/python/debpython/
version.py", line 24, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package python-pyasn1 (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up python-wheel (0.24.0-1) ...
Traceback (most recent call last):
File "/usr/bin/pycompile", line 35, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
File "/usr/share/python/debpython/
version.py", line 24, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package python-wheel (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
python-apt
apt-listchanges
python-ply
python-pycparser
python-cffi
python-colorama
python-cryptography
python-distlib
python-html5lib
python-openssl
python-ndg-httpsclient
python-urllib3
python-requests
python-setuptools
python-pip
python-pyasn1
python-wheel
E: Sub-process /usr/bin/dpkg returned an error code (1)
求助求助!