Не удается установить Telegram в Debian: ModuleNotFoundError: Нет модуля с именем «apt_pkg» - PullRequest
0 голосов
/ 24 мая 2018

Я пользователь Debian.

Я запускаю код в оболочке от имени root:

Я хочу установить телеграмму с помощью следующей команды:

sudo add-apt-repository ppa:atareao/telegram

sudo apt-get update

sudo apt-get install telegram

Iполучить следующую ошибку:

    Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 11, in <module>
    from softwareproperties.SoftwareProperties import SoftwareProperties, shortcut_handler
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 27, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
    from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
    import apport.fileutils
  File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
    from apport.packaging_impl import impl as packaging
  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in <module>
    import apt
  File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 11, in <module>
    from softwareproperties.SoftwareProperties import SoftwareProperties, shortcut_handler
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 27, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

как я могу ее исправить?

Спасибо

Ответы [ 2 ]

0 голосов
/ 26 мая 2018

Почему вы хотите загрузить и установить телеграмму из PPA?!
Следуйте за мной:
1) Загрузить Telegram Desktop с Telegram.Org
2) Извлечение архива в / opt
3) Выполнение / opt / Telegram / Telegram

Примечание. Приложение Telegram автоматически устанавливает файл telegramdesktop.desktop в меню приложения (~ / .local / share / Applications / telegramdesktop.desktop).в следующий раз нажмите только на иконку.

FINE.

0 голосов
/ 24 мая 2018

Способ установки telegram в Debian:

1) Пакет telegram можно установить через snap.

# apt install snapd

Чтобы найти пакет:

snap find telegram

Пример вывода:

Name                 Version     Developer       Notes  Summary
telegram-sergiusens  1.2.6       sergiusens      -      Telegram desktop client
telegram-cli         1.4.5       marius-quabeck  -      Command-line interface for Telegram. Uses the readline interface.
telegram-desktop     1.2.17      3v1n0           -      Official desktop client for the Telegram messenger
ubuntu-social-kit    3           keshavnrj       -      Bring social media apps to Ubuntu Desktop
squirrelbot          1.1.2       xordspar0       -      A Telegram bot that stashes away links that you send it
mup-plugins          2017.04.19  niemeyer        -      mup IRC and Telegram bot - plugins side
mup-accounts         2016.09.24  niemeyer        -      mup IRC and Telegram bot - account connection side
shell2telegram       1.7         msoap           -      Telegram bot constructor from command-line

Для установки telegram:

# snap install telegram-desktop

2) Пакет telegram-desktop доступен на stretch-backports.Отредактируйте /etc/apt/sources.list, добавив следующую строку:

deb http://deb.debian.org/debian/ stretch-backports main

Сохраните и запустите:

# apt update
# apt install telegram-desktop

Пакет доступен также для Debian Buster и Sid.

Удалите ppa:atareao/telegram (Под /etc/apt/sources.list.d/) и посмотрите ответ , связанный @aicastell, чтобы исправить ошибку.

...