簡體   English   中英

如何解決“apt-get install”由於python問題而不起作用的問題

[英]How to fix a problem that “apt-get install” doesn't work because of python issue

我正在使用 Ubuntu 16.04。我想使用“apt-get install”安裝一個與 ROS 相關的包,但它不起作用。 終端說如下。

$ sudo apt-get install ros-kinetic-libuvc
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:
 bzr : Depends: python:any
 gimp : Depends: python:any (>= 2.6.6-7~)
 gyp : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 inkscape : Depends: python:any (>= 2.7.5-5~)
 ipython : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 libboost-mpi-python1.58.0 : Depends: python (< 2.8) but 3.7.0-1 is to be installed
                             Depends: python:any (>= 2.7.5-5~)
 libboost-python1.58-dev : Depends: python:any (< 2.8)
                           Depends: python:any (>= 2.7.5-5~)
 libglib2.0-dev : Depends: python:any (>= 2.6.6-7~)
 meld : Depends: python:any (< 2.8)
        Depends: python:any (>= 2.7.5-5~)
 mercurial : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 mercurial-common : Depends: python:any (< 2.8)
                    Depends: python:any (>= 2.7.5-5~)
 python-all : Depends: python (= 2.7.12-1~16.04) but 3.7.0-1 is to be installed
 python-all-dev : Depends: python (= 2.7.12-1~16.04) but 3.7.0-1 is to be installed
 python-amqp : Depends: python:any (< 2.8)
               Depends: python:any (>= 2.7.5-5~)
 python-anyjson : Depends: python (< 2.8) but 3.7.0-1 is to be installed
                  Depends: python:any (>= 2.7.1-0ubuntu2)
 python-apt : Depends: python (< 2.8) but 3.7.0-1 is to be installed
              Depends: python:any (>= 2.7.5-5~)
 python-attr : Depends: python:any (< 2.8)
               Depends: python:any (>= 2.7.5-5~)
 python-autobahn : Depends: python:any (< 2.8)
                   Depends: python:any (>= 2.7.5-5~)
 python-billiard : Depends: python (< 2.8) but 3.7.0-1 is to be installed
                   Depends: python:any (>= 2.7.5-5~)
 python-blinker : Depends: python:any (< 2.8)
                  Depends: python:any (>= 2.7.5-5~)
 python-bluez : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-bs4 : Depends: python:any (< 2.8)
              Depends: python:any (>= 2.7.5-5~)
 python-bson : Depends: python:any (< 2.8)
               Depends: python:any (>= 2.7.5-5~)
 python-bson-ext : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-bzrlib : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-cairo : Depends: python (< 2.8) but 3.7.0-1 is to be installed
                Depends: python:any (>= 2.7.5-5~)
 python-catkin-pkg : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-catkin-pkg-modules : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-catkin-tools : Depends: python (< 2.8) but 3.7.0-1 is to be installed
                       Depends: python:any (>= 2.7.1-0ubuntu2)
 python-celery : Depends: python:any (< 2.8)
                 Depends: python:any (>= 2.7.5-5~)
 python-cffi-backend : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-chardet : Depends: python:any (< 2.8)
                  Depends: python:any (>= 2.7.5-5~)
 python-concurrent.futures : Depends: python:any (< 2.8)
                             Depends: python:any (>= 2.7.5-5~)
 python-configobj : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-coverage : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-crypto : Depends: python (< 2.8) but 3.7.0-1 is to be installed
                 Depends: python:any (>= 2.7.5-5~)
 python-cryptography : Depends: python (< 2.8) but 3.7.0-1 is to be installed
                       Depends: python:any (>= 2.7.5-5~)
 python-cycler : Depends: python:any (< 2.8)
                 Depends: python:any (>= 2.7.5-5~)
 python-dateutil : Depends: python:any (< 2.8)
                   Depends: python:any (>= 2.7.5-5~)
 python-dbus : Depends: python (< 2.8) but 3.7.0-1 is to be installed
               Depends: python:any (>= 2.7.5-5~)
 python-decorator : Depends: python:any (< 2.8)
                    Depends: python:any (>= 2.7.5-5~)
 python-defusedxml : Depends: python:any (< 2.8)
                     Depends: python:any (>= 2.7.5-5~)
 python-dev : Depends: python (= 2.7.12-1~16.04) but 3.7.0-1 is to be installed
 python-docutils : Depends: python:any (>= 2.7.5-5~)
                   Depends: python:any (< 2.8)
 python-ecdsa : Depends: python:any (< 2.8)
                Depends: python:any (>= 2.7.5-5~)
 python-empy : Depends: python:any (< 2.8)
               Depends: python:any (>= 2.7.5-5~)
 python-enum34 : Depends: python:any (< 2.8)
                 Depends: python:any (>= 2.7.5-5~)
 python-flask : Depends: python:any (< 2.8)
                Depends: python:any (>= 2.7.5-5~)
 python-funcsigs : Depends: python:any (< 2.8)
                   Depends: python:any (>= 2.7.5-5~)
 python-gi : Depends: python (< 2.8) but 3.7.0-1 is to be installed
             Depends: python:any (>= 2.7.5-5~)
 python-gi-cairo : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-git : Depends: python:any (< 2.8)
              Depends: python:any (>= 2.7.5-5~)
 python-gitdb : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-glade2 : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-gobject-2 : Depends: python (< 2.8) but 3.7.0-1 is to be installed
                    Depends: python:any (>= 2.7.5-5~)
 python-gpgme : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-gridfs : Depends: python:any (< 2.8)
                 Depends: python:any (>= 2.7.5-5~)
 python-gtk2 : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-html5lib : Depends: python:any (< 2.8)
                   Depends: python:any (>= 2.7.5-5~)
 python-httplib2 : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-idna : Depends: python:any (< 2.8)
               Depends: python:any (>= 2.7.5-5~)
 python-imaging : Depends: python:any (< 2.8)
                  Depends: python:any (>= 2.7.5-5~)
 python-ipaddress : Depends: python:any (< 2.8)
                    Depends: python:any (>= 2.7.5-5~)
 python-itsdangerous : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-jinja2 : Depends: python:any (< 2.8)
                 Depends: python:any (>= 2.7.5-5~)
 python-keyring : Depends: python:any (< 2.8)
                  Depends: python:any (>= 2.7.5-5~)
 python-kombu : Depends: python:any (< 2.8)
                Depends: python:any (>= 2.7.5-5~)
 python-launchpadlib : Depends: python:any (< 2.8)
                       Depends: python:any (>= 2.7.5-5~)
 python-lazr.restfulclient : Depends: python:any (< 2.8)
                             Depends: python:any (>= 2.7.5-5~)
 python-lazr.uri : Depends: python:any (< 2.8)
                   Depends: python:any (>= 2.7.5-5~)
 python-lxml : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-lz4 : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-mailer : Depends: python:any (< 2.8)
                 Depends: python:any (>= 2.7.5-5~)
 python-markupsafe : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-matplotlib : Depends: python (< 2.8) but 3.7.0-1 is to be installed
                     Depends: python:any (>= 2.7.5-5~)
 python-mechanize : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-memcache : Depends: python:any (< 2.8)
                   Depends: python:any (>= 2.7.5-5~)
 python-mock : Depends: python:any (< 2.8)
               Depends: python:any (>= 2.7.5-5~)
 python-mpi4py : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-msgpack : Depends: python (< 2.8) but 3.7.0-1 is to be installed
                  Depends: python:any (>= 2.7.5-5~)
 python-netifaces : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-nose : Depends: python:any (< 2.8)
               Depends: python:any (>= 2.7.5-5~)
 python-numpy : Depends: python (< 2.8) but 3.7.0-1 is to be installed
                Depends: python:any (>= 2.7.5-5~)
 python-oauth : Depends: python:any (< 2.8)
                Depends: python:any (>= 2.7.5-5~)
 python-opengl : Depends: python:any (< 2.8)
                 Depends: python:any (>= 2.7.5-5~)
                 Depends: python-ctypes
 python-openssl : Depends: python:any (< 2.8)
                  Depends: python:any (>= 2.7.5-5~)
 python-osrf-pycommon : Depends: python (< 2.8) but 3.7.0-1 is to be installed
                        Depends: python:any (>= 2.7.1-0ubuntu2)
 python-pam : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-paramiko : Depends: python:any (< 2.8)
                   Depends: python:any (>= 2.7.5-5~)
 python-pbr : Depends: python:any (< 2.8)
              Depends: python:any (>= 2.7.5-5~)
 python-pexpect : Depends: python:any (< 2.8)
                  Depends: python:any (>= 2.7.5-5~)
 python-pil : Depends: python (< 2.8) but 3.7.0-1 is to be installed
              Depends: python:any (>= 2.7.5-5~)
 python-pil.imagetk : Depends: python (< 2.8) but 3.7.0-1 is to be installed
                      Depends: python:any (>= 2.7.5-5~)
 python-pip : Depends: python:any (< 2.8)
              Depends: python:any (>= 2.7.5-5~)
 python-pkg-resources : Depends: python:any (< 2.8)
                        Depends: python:any (>= 2.7.5-5~)
 python-psutil : Depends: python (< 2.8) but 3.7.0-1 is to be installed
                 Depends: python:any (>= 2.7.5-5~)
 python-ptyprocess : Depends: python:any (< 2.8)
                     Depends: python:any (>= 2.7.5-5~)
 python-pyasn1 : Depends: python:any (< 2.8)
                 Depends: python:any (>= 2.7.5-5~)
 python-pyasn1-modules : Depends: python:any (< 2.8)
                         Depends: python:any (>= 2.7.5-5~)
 python-pyassimp : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pycurl : Depends: python (< 2.8) but 3.7.0-1 is to be installed
                 Depends: python:any (>= 2.7.5-5~)
 python-pydot : Depends: python:any (< 2.8)
                Depends: python:any (>= 2.7.5-5~)
 python-pygments : Depends: python:any (< 2.8)
                   Depends: python:any (>= 2.7.5-5~)
 python-pyinotify : Depends: python:any (< 2.8)
                    Depends: python:any (>= 2.7.5-5~)
 python-pymongo : Depends: python:any (< 2.8)
                  Depends: python:any (>= 2.7.5-5~)
 python-pymongo-ext : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyparsing : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyqt5 : Depends: python (< 2.8) but 3.7.0-1 is to be installed
                Depends: python:any (>= 2.7.5-5~)
 python-pyqt5.qtopengl : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyqt5.qtsvg : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyqt5.qtwebkit : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyside.phonon : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyside.qtcore : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyside.qtdeclarative : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyside.qtgui : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyside.qthelp : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyside.qtnetwork : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyside.qtopengl : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyside.qtscript : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyside.qtsql : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyside.qtsvg : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyside.qttest : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyside.qtuitools : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyside.qtwebkit : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyside.qtxml : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyside2.qtconcurrent : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyside2.qtcore : Depends: python (< 2.8) but 3.7.0-1 is to be installed
                         Depends: python:any (>= 2.7.5-5~)
 python-pyside2.qtgui : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyside2.qthelp : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyside2.qtnetwork : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyside2.qtprintsupport : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyside2.qtscript : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyside2.qtsql : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyside2.qtsvg : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyside2.qttest : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyside2.qtuitools : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyside2.qtwebkit : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyside2.qtwebkitwidgets : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyside2.qtwidgets : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyside2.qtx11extras : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-pyside2.qtxml : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-qt4 : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-rdkit : Depends: python (< 2.8) but 3.7.0-1 is to be installed
                Depends: python:any (>= 2.7.5-5~)
 python-roman : Depends: python:any (< 2.8)
                Depends: python:any (>= 2.7.5-5~)
 python-rosdep : Depends: python (< 2.8) but 3.7.0-1 is to be installed
                 Depends: python:any (>= 2.7.1-0ubuntu2)
 python-rosdistro : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-rosdistro-modules : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-rosinstall : Depends: python (< 2.8) but 3.7.0-1 is to be installed
                     Depends: python:any (>= 2.7.1-0ubuntu2)
 python-rosinstall-generator : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-rospkg : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-rospkg-modules : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-scipy : Depends: python (< 2.8) but 3.7.0-1 is to be installed
                Depends: python:any (>= 2.7.5-5~)
 python-secretstorage : Depends: python:any (< 2.8)
                        Depends: python:any (>= 2.7.5-5~)
 python-serial : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-service-identity : Depends: python:any (< 2.8)
                           Depends: python:any (>= 2.7.5-5~)
 python-setuptools : Depends: python:any (< 2.8)
                     Depends: python:any (>= 2.7.5-5~)
 python-simplegeneric : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-simplejson : Depends: python (< 2.8) but 3.7.0-1 is to be installed
                     Depends: python:any (>= 2.7.5-5~)
 python-sip : Depends: python (< 2.8) but 3.7.0-1 is to be installed
              Depends: python:any (>= 2.7.5-5~)
 python-sip-dev : Depends: python:any (< 2.8)
                  Depends: python:any (>= 2.7.5-5~)
 python-six : Depends: python:any (< 2.8)
              Depends: python:any (>= 2.7.5-5~)
 python-skimage : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-skimage-lib : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-smmap : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-snappy : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-software-properties : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-talloc : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-tk : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-trollius : Depends: python:any (< 2.8)
                   Depends: python:any (>= 2.7.5-5~)
 python-twisted : Depends: python:any (< 2.8)
                  Depends: python:any (>= 2.7~)
 python-twisted-bin : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-twisted-core : Depends: python:any (< 2.8)
                       Depends: python:any (>= 2.7.5-5~)
 python-txaio : Depends: python:any (< 2.8)
                Depends: python:any (>= 2.7.5-5~)
 python-tz : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-vcstools : Depends: python (< 2.8) but 3.7.0-1 is to be installed
                   Depends: python:any (>= 2.7.1-0ubuntu2)
 python-vtk6 : Depends: python (< 2.8) but 3.7.0-1 is to be installed
               Depends: python:any (>= 2.7.5-5~)
 python-wadllib : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-werkzeug : Depends: python:any (< 2.8)
                   Depends: python:any (>= 2.7.5-5~)
 python-wheel : Depends: python:any (< 2.8)
                Depends: python:any (>= 2.7.5-5~)
 python-wstool : Depends: python (< 2.8) but 3.7.0-1 is to be installed
                 Depends: python:any (>= 2.7.1-0ubuntu2)
 python-wxgtk3.0 : Depends: python (< 2.8) but 3.7.0-1 is to be installed
                   Depends: python:any (>= 2.7.5-5~)
 python-wxversion : Depends: python:any (< 2.8)
                    Depends: python:any (>= 2.7.5-5~)
 python-yaml : Depends: python (< 2.8) but 3.7.0-1 is to be installed
 python-zope.interface : Depends: python (< 2.8) but 3.7.0-1 is to be installed
                         Depends: python:any (>= 2.7.5-5~)
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

然后我嘗試了“apt-get -f install”,但它也不能像下面那樣工作。

$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
 bzr : Depends: python:any
 gimp : Depends: python:any (>= 2.6.6-7~)
 gyp : Depends: python (< 2.8) but 3.7.0-1 is installed
 inkscape : Depends: python:any (>= 2.7.5-5~)
 ipython : Depends: python (< 2.8) but 3.7.0-1 is installed
 libboost-mpi-python1.58.0 : Depends: python (< 2.8) but 3.7.0-1 is installed
                             Depends: python:any (>= 2.7.5-5~)
 libboost-python1.58-dev : Depends: python:any (< 2.8)
                           Depends: python:any (>= 2.7.5-5~)
 libglib2.0-dev : Depends: python:any (>= 2.6.6-7~)
 meld : Depends: python:any (< 2.8)
        Depends: python:any (>= 2.7.5-5~)
 mercurial : Depends: python (< 2.8) but 3.7.0-1 is installed
 mercurial-common : Depends: python:any (< 2.8)
                    Depends: python:any (>= 2.7.5-5~)
 .....
 python-zope.interface : Depends: python (< 2.8) but 3.7.0-1 is installed
                         Depends: python:any (>= 2.7.5-5~)
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies

這些錯誤指的是 python 3.7。 我從源代碼安裝了 python 3.7。 我已經從 /usr/bin 和 /usr/local/bin 中刪除了 python 3.7。 但是,上述問題尚未解決。 默認版本 python 3.5 仍然有效,所以我可以在我的電腦上使用 python3。

誰能建議我如何解決問題和我的電腦? 我需要避免清理操作系統。

Ubuntu 依賴於安裝的特定版本的 Python。 在 16.04 中, /usr/bin/python必須是2.7/usr/bin/python3必須是3.5 從源代碼安裝 Python 的make install步驟可以覆蓋這些文件。 值得慶幸的是,它們只是符號鏈接,因此修復它應該很容易。 作為根:

# ln -sf python2.7 /usr/bin/python
# ln -sf python3.5 /usr/bin/python3

但是,如果您確實需要二進制文件,則可以使用上面的鏈接。 只需選擇您的架構,然后選擇一面鏡子。 或者使用apt download python python3 ,如果它有效。 然后使用dpkg -i安裝軟件包。

然后將 3.7 安裝回/usr/bin/python3.7 ,我相信您可以運行make altinstall

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM