Debian Stretch中的依赖问题 [英] Dependency problems in Debian Stretch

查看:293
本文介绍了Debian Stretch中的依赖问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了 Debian GNU/Linux 9(拉伸)的全新安装.我已经安装了python3.7.2和一些python-packages.在尝试使用 sudo apt-get install python3-spyder 安装spyder3之后,无论何时尝试安装或删除软件包,我都会不断收到错误消息.

I have a pretty fresh installation of Debian GNU/Linux 9 (stretch). I have installed python3.7.2 and some python-packages. After attempting to install spyder3 using sudo apt-get install python3-spyder, I keep getting error messages whenever I attempt to install or remove packages.

例如,运行 sudo apt-get install unixodbc 会给出以下输出:

For instance, running sudo apt-get install unixodbc give the following output:

~$ sudo apt-get install unixodbc
Reading package lists... Done
Building dependency tree       
Reading state information... Done
unixodbc is already the newest version (2.3.4-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
12 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-wrapt (1.9.0-2) ...
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
ModuleNotFoundError: No module named 'ConfigParser'
dpkg: error processing package python-wrapt (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-isort (4.2.5+ds1-2+deb9u1) ...
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
ModuleNotFoundError: No module named 'ConfigParser'
dpkg: error processing package python-isort (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-lazy-object-proxy (1.2.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
ModuleNotFoundError: No module named 'ConfigParser'
dpkg: error processing package python-lazy-object-proxy (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of pylint:
 pylint depends on python-isort; however:
  Package python-isort is not configured yet.

dpkg: error processing package pylint (--configure):
 dependency problems - leaving unconfigured
Setting up python-backports.functools-lru-cache (1.3-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
ModuleNotFoundError: No module named 'ConfigParser'
dpkg: error processing package python-backports.functools-lru-cache (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-pyflakes (1.3.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
ModuleNotFoundError: No module named 'ConfigParser'
dpkg: error processing package python-pyflakes (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of python3-spyder:
 python3-spyder depends on pylint; however:
  Package pylint is not configured yet.

dpkg: error processing package python3-spyder (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-astroid:
 python-astroid depends on python-lazy-object-proxy; however:
  Package python-lazy-object-proxy is not configured yet.
 python-astroid depends on python-wrapt; however:
  Package python-wrapt is not configured yet.

dpkg: error processing package python-astroid (--configure):
 dependency problems - leaving unconfigured
Setting up python-sip (4.18.1+dfsg-2) ...
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
ModuleNotFoundError: No module named 'ConfigParser'
dpkg: error processing package python-sip (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of python-pyqt5:
 python-pyqt5 depends on sip-api-11.3; however:
  Package sip-api-11.3 is not installed.
  Package python-sip which provides sip-api-11.3 is not configured yet.

dpkg: error processing package python-pyqt5 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of pyflakes:
 pyflakes depends on python-pyflakes (>= 1.0.0-2); however:
  Package python-pyflakes is not configured yet.

dpkg: error processing package pyflakes (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-pyqt5.qtwebkit:
 python-pyqt5.qtwebkit depends on python-pyqt5 (= 5.7+dfsg-5); however:
  Package python-pyqt5 is not configured yet.

dpkg: error processing package python-pyqt5.qtwebkit (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 python-wrapt
 python-isort
 python-lazy-object-proxy
 pylint
 python-backports.functools-lru-cache
 python-pyflakes
 python3-spyder
 python-astroid
 python-sip
 python-pyqt5
 pyflakes
 python-pyqt5.qtwebkit
E: Sub-process /usr/bin/dpkg returned an error code (1)

这基本上也是我在运行 sudo dpkg --configure -a 时获得的输出.

This is basically the same output I get when running sudo dpkg --configure -a, also.

我尝试了这篇文章中描述的所有方法,并且此线程,但是它们都不能解决问题.

I have tried every method described at this post and this thread, but none of them fixes the problem.

推荐答案

弄清楚了.我已经使用

sudo update-alternatives --install /usr/bin/python python /usr/local/bin/python3.7 1

这是我问题的根源.要修复它,我将其重置为python2.7.

This is the source of my problems. To fix it, I reset it to python2.7.

sudo update-alternatives --remove python /usr/local/bin/python3.7
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1

那我就可以做

sudo dpkg --configure -a

这篇关于Debian Stretch中的依赖问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆