paul-nameless / tg

terminal telegram client
The Unlicense
929 stars 76 forks source link

No such file or directory error when launching tg #300

Open KRC2000 opened 1 year ago

KRC2000 commented 1 year ago

image Linux mint, on first launch asked for number, when it was entered - this error. All following relaunches show this error immediately, was installed with pip3 install tg

victorryakh commented 1 year ago

Same on Lubuntu 22.10, but I can't even launch it via tg command

v@laptop:~$ tg
Command 'tg' not found, but can be installed with:
sudo apt install topgit
v@laptop:~$ ./.local/bin/tg
find: ‘/home/v/.cache/tg/files’: No such file or directory
Traceback (most recent call last):
  File "/home/v/./.local/bin/tg", line 8, in <module>
    sys.exit(main())
  File "/home/v/.local/lib/python3.10/site-packages/tg/__main__.py", line 60, in main
    tg = Tdlib(
  File "/home/v/.local/lib/python3.10/site-packages/telegram/client.py", line 136, in __init__
    self._tdjson = TDJson(library_path=library_path, verbosity=tdlib_verbosity)
  File "/home/v/.local/lib/python3.10/site-packages/telegram/tdjson.py", line 27, in __init__
    self._build_client(library_path, verbosity)
  File "/home/v/.local/lib/python3.10/site-packages/telegram/tdjson.py", line 34, in _build_client
    self._tdjson = CDLL(library_path)
  File "/usr/lib/python3.10/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libssl.so.1.1: cannot open shared object file: No such file or directory
aleeessio commented 1 year ago

Unfortunately I get the same thing not only on my main linux machine (Ubuntu 22.10) but also on a linux docker container that runs Ubuntu 22.04. Here the error:

root@d33357df4709:~# tg
Traceback (most recent call last):
  File "/usr/local/bin/tg", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/dist-packages/tg/__main__.py", line 60, in main
    tg = Tdlib(
  File "/usr/local/lib/python3.10/dist-packages/telegram/client.py", line 136, in __init__
    self._tdjson = TDJson(library_path=library_path, verbosity=tdlib_verbosity)
  File "/usr/local/lib/python3.10/dist-packages/telegram/tdjson.py", line 27, in __init__
    self._build_client(library_path, verbosity)
  File "/usr/local/lib/python3.10/dist-packages/telegram/tdjson.py", line 34, in _build_client
    self._tdjson = CDLL(library_path)
  File "/usr/lib/python3.10/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libssl.so.1.1: cannot open shared object file: No such file or directory
find: ‘/root/.cache/tg/files’: No such file or directory
aleeessio commented 1 year ago

UPDATE! @victorryakh @KRC2000 I tried do something by installing manually the library:

1. sudo apt update && sudo apt upgrade -y && sudo apt install -y wget
2. wget http://archive.debian.org/debian-archive/debian-security/pool/updates/main/o/openssl/libssl1.1_1.1.0l-1~deb9u6_amd64.deb
3. dpgk -i  libssl1.1_1.1.0l-1~deb9u6_amd64.deb

The error is pretty the same, dispite it's shown in a different way. However thus we can be sure that the problem is the version of libssl. We should install the 1.1 even in the folder of python packages but I don't know how

Traceback (most recent call last):
  File "/usr/local/bin/tg", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/dist-packages/tg/__main__.py", line 60, in main
    tg = Tdlib(
  File "/usr/local/lib/python3.10/dist-packages/telegram/client.py", line 136, in __init__
    self._tdjson = TDJson(library_path=library_path, verbosity=tdlib_verbosity)
  File "/usr/local/lib/python3.10/dist-packages/telegram/tdjson.py", line 27, in __init__
    self._build_client(library_path, verbosity)
  File "/usr/local/lib/python3.10/dist-packages/telegram/tdjson.py", line 34, in _build_client
    self._tdjson = CDLL(library_path)
  File "/usr/lib/python3.10/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /lib/x86_64-linux-gnu/libcrypto.so.1.1: version `OPENSSL_1_1_1' not found (required by /usr/local/lib/python3.10/dist-packages/telegram/lib/linux/libtdjson.so)
find: ‘/root/.cache/tg/files’: No such file or directory