“IOError: недопустимая установка Python: не мог открыть/usr/lib/python2.7/config/Makefile” конфигурирование минимального Python

Я обновил Ubuntu от 17,04 до 17,10 и затем к 18,04, и теперь мой Python, кажется, повреждается. Выполнение apt-get upgrade возвраты следующие ошибки:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libopencv-highgui3.1 : Depends: libopencv-videoio3.1 (= 3.1.0+dfsg1-1~exp1ubuntu3) but it is not installable
                        Depends: libopencv-imgcodecs3.1 but it is not installable
 libopencv-videostab3.1 : Depends: libopencv-videoio3.1 but it is not installable
 libpython-all-dev : Depends: libpython-dev (= 2.7.14-2ubuntu1) but 2.7.15~rc1-1 is installed
 python : PreDepends: python-minimal (= 2.7.13-2) but 2.7.15~rc1-1 is installed
          Depends: libpython-stdlib (= 2.7.13-2) but 2.7.14-2ubuntu1 is installed
 python-all : Depends: python (= 2.7.15~rc1-1) but 2.7.13-2 is installed
 python-all-dev : Depends: python (= 2.7.15~rc1-1) but 2.7.13-2 is installed
                  Depends: libpython-all-dev (= 2.7.15~rc1-1) but 2.7.14-2ubuntu1 is installed
 python-dev : Depends: python (= 2.7.15~rc1-1) but 2.7.13-2 is installed
 ubuntu-release-upgrader-core : Depends: python3-distupgrade (= 1:18.04.17) but 1:17.10.11 is installed
 ubuntu-release-upgrader-gtk : Depends: python3-distupgrade (= 1:18.04.17) but 1:17.10.11 is installed
 update-manager : Depends: update-manager-core (= 1:18.04.11) but 1:17.10.13 is installed
                  Depends: libgtk3-perl but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Выполнение apt --fix-broken install результаты по следующей ошибке:

Setting up python-minimal (2.7.15~rc1-1) ...
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site.py", line 563, in <module>
    main()
  File "/usr/local/lib/python2.7/site.py", line 545, in main
    known_paths = addusersitepackages(known_paths)
  File "/usr/local/lib/python2.7/site.py", line 278, in addusersitepackages
    user_site = getusersitepackages()
  File "/usr/local/lib/python2.7/site.py", line 253, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
  File "/usr/local/lib/python2.7/site.py", line 243, in getuserbase
    USER_BASE = get_config_var('userbase')
  File "/usr/local/lib/python2.7/sysconfig.py", line 521, in get_config_var
    return get_config_vars().get(name)
  File "/usr/local/lib/python2.7/sysconfig.py", line 420, in get_config_vars
    _init_posix(_CONFIG_VARS)
  File "/usr/local/lib/python2.7/sysconfig.py", line 288, in _init_posix
    raise IOError(msg)
IOError: invalid Python installation: unable to open /usr/lib/python2.7/config/Makefile (No such file or directory)
dpkg: error processing package python-minimal (--configure):
 installed python-minimal package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 python-minimal
E: Sub-process /usr/bin/dpkg returned an error code (1)

У кого-то есть идея о том, как зафиксировать это?

5
задан 24 April 2019 в 07:01

1 ответ

Я не знаю почему, но python2.7 указанный /usr/local/bin/python2.7 который имел версию 2.7.3, в то время как python указанный /usr/bin/python2.7 который имел версию 2.7.15.

Я просто переименовал /usr/local/bin/python2.7 и теперь apt-get upgrade работает как ожидалось.

1
ответ дан 23 November 2019 в 10:40

Другие вопросы по тегам:

Похожие вопросы: