我是 Ubuntu (16.04) 的新手,使用 apt 时也遇到了同样的错误。当我通过下载 APT 存储库并使用 dpkg 安装 MySQL 时,它就开始了。之后我清除了 MySQL,但我仍然不断收到此输出。我有默认的 python 2.7.12 和 3.5.2,还有带有 3.6.2 的 anaconda。我猜这个错误是由于 python 版本冲突造成的,但我不知道为什么它只在我安装 MySQL 后才开始。
任何帮助都值得感激。谢谢。
name@xyz:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
13 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
Setting up python-pymysql (0.7.2-1ubuntu1) ...
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-pymysql (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up python-decorator (4.0.6-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-decorator (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up python-ptyprocess (0.5-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-ptyprocess (--configure):
subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of python-pexpect:
python-pexpect depends on python-ptyprocess; however:
Package python-ptyprocess is not configured yet.
dpkg: error processing package python-pexpect (--configure):
dependency problems - leaving unconfigured
Setting up python-simplegeneric (0.8.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-simplegeneric (--configure):
subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of ipython:
ipython depends on python-decorator; however:
Package python-decorator is not configured yet.
ipython depends on python-pexpect; however:
Package python-pexpect is not configured yet.
ipython depends on python-simplegeneric; however:
Package python-simplegeneric is not configured yet.
dpkg: error processing package ipython (--configure):
dependency problems - leaving unconfigured
Setting up python-markupsafe (0.23-2build2) ...
No apport report written because MaxReports is reached already
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-markupsafe (--configure):
subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of python-jinja2:
python-jinja2 depends on python-markupsafe; however:
Package python-markupsafe is not configured yet.
dpkg: error processing package python-jinja2 (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
Setting up python-pycurl (7.43.0-1ubuntu1) ...
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-pycurl (--configure):
subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of python-tornado:
python-tornado depends on python-pycurl; however:
Package python-pycurl is not configured yet.
dpkg: error processing package python-tornado (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
Setting up python-zmq (15.2.0-0ubuntu4) ...
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-zmq (--configure):
subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of ipython-notebook:
ipython-notebook depends on ipython (= 2.4.1-1); however:
Package ipython is not configured yet.
ipython-notebook depends on python-jinja2; however:
Package python-jinja2 is not configured yet.
ipython-notebook depends on python-tornado (>= 3.1.0); however:
Package python-tornado is not configured yet.
ipython-notebook depends on python-zmq (>= 2.1.11); however:
Package python-zmq is not configured yet.
dpkg: error processing package ipython-notebook (--configure):
dependency problems - leaving unconfigured
Setting up python-pkg-resources (20.7.0-1) ...
No apport report written because MaxReports is reached already
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-pkg-resources (--configure):
subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
Errors were encountered while processing:
python-pymysql
python-decorator
python-ptyprocess
python-pexpect
python-simplegeneric
ipython
python-markupsafe
python-jinja2
python-pycurl
python-tornado
python-zmq
ipython-notebook
python-pkg-resources
E: Sub-process /usr/bin/dpkg returned an error code (1)
这是评论中要求的输出:
name@xyz:~$ apt-cache policy python-minimal
python-minimal:
Installed: 2.7.11-1
Candidate: 2.7.11-1
Version table:
*** 2.7.11-1 500
500 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
100 /var/lib/dpkg/status
name@xyz:/usr/share/python/debpython$ dpkg -S version.py
python3-minimal: /usr/share/python3/debpython/version.py
python-minimal: /usr/share/python/debpython/version.py
python3-checkbox-support: /usr/lib/python3/dist-packages/checkbox_support/lib/conversion.py
dh-python: /usr/share/dh-python/dhpython/version.py
python3-checkbox-support: /usr/lib/python3/dist-packages/checkbox_support/parsers/tests/test_version.py
libpython2.7-stdlib:amd64: /usr/lib/python2.7/distutils/version.py
ipython: /usr/lib/python2.7/dist-packages/IPython/utils/version.py
python3-defer: /usr/lib/python3/dist-packages/defer/version.py
python3-dbus: /usr/lib/python3/dist-packages/dbus/_version.py
python3-setuptools: /usr/lib/python3/dist-packages/setuptools/version.py
libpython3.5-stdlib:amd64: /usr/lib/python3.5/distutils/version.py
ibus-table: /usr/share/ibus-table/setup/version.py
python-zmq: /usr/lib/python2.7/dist-packages/zmq/tests/test_version.py
python3-pip: /usr/lib/python3/dist-packages/pip/vcs/subversion.py
python3-pkg-resources: /usr/lib/python3/dist-packages/pkg_resources/_vendor/packaging/version.py
python-pkg-resources: /usr/lib/python2.7/dist-packages/pkg_resources/_vendor/packaging/version.py
python-zmq: /usr/lib/python2.7/dist-packages/zmq/sugar/version.py
ajay@AJB-UX330UAK:/usr/share/python/debpython$ ^C