Ошибка при установке Python 3.7 - E: Подпроцесс / usr / bin / dpkg вернул код ошибки (1) - PullRequest
0 голосов
/ 14 октября 2019

Я пытался установить python 3.7 в моем виртуальном ящике Ubuntu, используя 'sudo apt-get install python3.7'. Тем не менее, я получил следующий вывод: -

Building dependency tree       
Reading state information... Done
python3.7 is already the newest version (3.7.4-2~16.04.york1).
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 libpython3.7 : Depends: libpython3.7-stdlib (= 3.7.4-2~16.04.york1) but 3.7.4-1+xenial2 is to be installed
 libpython3.7-dev : Depends: libpython3.7-stdlib (= 3.7.4-2~16.04.york1) but 3.7.4-1+xenial2 is to be installed
 libpython3.7-stdlib : Depends: libpython3.7-minimal (= 3.7.4-1+xenial2) but 3.7.4-2~16.04.york1 is to be installed
 python3.7 : Depends: libpython3.7-stdlib (= 3.7.4-2~16.04.york1) but 3.7.4-1+xenial2 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

После этого я попытался выполнить 'apt-get -f install', как рекомендовано в вышеприведенном выводе, но затем я получил следующее: -

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  libpython3.7-stdlib
The following packages will be upgraded:
  libpython3.7-stdlib
1 upgraded, 0 newly installed, 0 to remove and 209 not upgraded.
4 not fully installed or removed.
Need to get 0 B/1,756 kB of archives.
After this operation, 66.6 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 189831 files and directories currently installed.)
Preparing to unpack .../libpython3.7-stdlib_3.7.4-2~16.04.york1_amd64.deb ...
Unpacking libpython3.7-stdlib:amd64 (3.7.4-2~16.04.york1) over (3.7.4-1+xenial2) ...
dpkg: error processing archive /var/cache/apt/archives/libpython3.7-stdlib_3.7.4-2~16.04.york1_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/python3.7/distutils/__init__.py', which is also in package python3.7-distutils 3.7.4-1+xenial2
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/libpython3.7-stdlib_3.7.4-2~16.04.york1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Обновление:

Несмотря на то, что ошибка говорит о том, что python3.7 уже существует, когда я выполняю python, я получаю следующее:

Python 2.7.12 (default, Oct  8 2019, 14:14:10) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.

И ниже, когда я запускаю 'python3': -

Python 3.5.2 (default, Oct  8 2019, 13:06:37) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.

Все, что я хочу сделать, это установить Python 3.7.

Может кто-нибудь любезно помочь мне с этой ошибкой?

1 Ответ

0 голосов
/ 14 октября 2019

Я вижу следующее в ваших логах

python3.7 is already the newest version (3.7.4-2~16.04.york1).

Там написано, что python3.7 уже установлен.

Вы можете просто попробовать python или python3в командной строке посмотрите, что там написано? если вы видите что-то похожее ниже, оно успешно установлено

  Python 3.7.3 (v3.7.3 Oct  3 2017, 00:32:08) 
 [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on XXX
 Type "help", "copyright", "credits" or "license" for more information.
...