Error in tonlibjson.__del__: 'TonLib' object has no attribute '_tonlib_json_client_destroy'
raceback (most recent call last):
File "D:\tonTgWallet\main.py", line 6, in <module>
client.init_tonlib()
File "D:\tonTgWallet\venv\lib\site-packages\ton\sync.py", line 19, in syncified
return loop.run_until_complete(coro)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete
return future.result()
File "D:\tonTgWallet\venv\lib\site-packages\ton\client\tonlib_methods.py", line 67, in init_tonlib
wrapper = TonLib(self.loop, self.ls_index, cdll_path, self.verbosity_level, default_timeout=self.default_timeout)
File "D:\tonTgWallet\venv\lib\site-packages\ton\tonlibjson.py", line 92, in __init__
tonlib = CDLL(cdll_path)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\ctypes\__init__.py", line 374, in __init__
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'D:\tonTgWallet\venv\lib\site-packages\ton\distlib\windows\tonlibjson.amd64.dll' (or one of its dependencies). Try using the full path with constructor syntax.
Exception in tonlibjson.__del__: Traceback (most recent call last):
File "D:\tonTgWallet\venv\lib\site-packages\ton\tonlibjson.py", line 133, in __del__
self._tonlib_json_client_destroy(self._client)
AttributeError: 'TonLib' object has no attribute '_tonlib_json_client_destroy'
Exception ignored in: <function TonLib.__del__ at 0x000002593A6F0CA0>
Traceback (most recent call last):
File "D:\tonTgWallet\venv\lib\site-packages\ton\tonlibjson.py", line 136, in __del__
RuntimeError: Error in tonlibjson.__del__: 'TonLib' object has no attribute '_tonlib_json_client_destroy'
Getting this issue so can't just start my script
The whole code:
from ton.sync import TonlibClient
client = TonlibClient(ls_index=None)
TonlibClient.enable_unaudited_binaries()
client.init_tonlib()
wallet = client.create_wallet()
print(wallet)
Try to provide path for ur libtonlibjson.so file like this client.init_tonlib(cdll_path='/usr/bin/ton/tonlib/libtonlibjson.so').
maybe open SSL version is not suitable, try to Install OpenSSL v1.1.1 for Win64 from https://slproweb.com/products/Win32OpenSSL.html.
have this problem too
How did you guys solve this issue? I am having it when i tried to deploy on AWS, locally works, seems its something related to cdll_path
I had a similar error in Ubuntu 22.04, but I had this error caused by the absence of libcrypto.so.1.1:
OSError: libcrypto.so.1.1: cannot open shared object file: No such file or directory
To solve this problem, I used the following method: https://stackoverflow.com/a/72633324
have this problem too
I have the same situation, please help me