Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The first example from the documentation leads to an error. RuntimeError: Error in tonlibjson.__del__: 'TonLib' object has no attribute '_tonlib_json_client_destroy' #63

Open
QuisEgoSum opened this issue Jul 23, 2024 · 4 comments

Comments

@QuisEgoSum
Copy link

pytonlib 0.0.63
python 3.11

import requests
import asyncio
from pathlib import Path

from pytonlib import TonlibClient


async def main():
    # downloading mainnet config
    ton_config = requests.get('https://ton.org/global.config.json').json()

    # create keystore directory for tonlib
    keystore_dir = '/tmp/ton_keystore'
    Path(keystore_dir).mkdir(parents=True, exist_ok=True)

    # init TonlibClient
    client = TonlibClient(ls_index=0,  # choose LiteServer index to connect
                          config=ton_config,
                          keystore=keystore_dir)

    # init tonlibjson
    await client.init()


if __name__ == '__main__':
    asyncio.run(main())
Traceback (most recent call last):
  File "<rootPath>/main.py", line 26, in <module>
    asyncio.run(main())
  File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "<rootPath>/main.py", line 22, in main
    await client.init()
  File "<rootPath>/.venv/lib/python3.11/site-packages/pytonlib/client.py", line 71, in init
    wrapper = TonLib(event_loop, self.ls_index, self.cdll_path, self.verbosity_level)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<rootPath>/.venv/lib/python3.11/site-packages/pytonlib/tonlibjson.py", line 81, in __init__
    tonlib = CDLL(cdll_path)
             ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/ctypes/__init__.py", line 376, in __init__
    self._handle = _dlopen(self._name, mode)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: libsecp256k1.so.0: cannot open shared object file: No such file or directory
Exception in tonlibjson.__del__: Traceback (most recent call last):
  File "<rootPath>/.venv/lib/python3.11/site-packages/pytonlib/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 0x7f50ba77cd60>
Traceback (most recent call last):
  File "<rootPath>/.venv/lib/python3.11/site-packages/pytonlib/tonlibjson.py", line 136, in __del__
RuntimeError: Error in tonlibjson.__del__: 'TonLib' object has no attribute '_tonlib_json_client_destroy'
@Morrigan-Ship
Copy link

same
ubuntu 24

@complicat9d
Copy link

same ubuntu 24

Had the same issue, while deploying my application on a Ubuntu 22.04 server. To ensure that pytonlib works, you have to make sure you are using SSL 1.1.1. The first comment in this problem says how to install it.

For reference: it is stated in one of the pytonlib dev's videos in the comments, so you might as well find something helpful there.

@Morrigan-Ship
Copy link

thank you

@exaho
Copy link

exaho commented Sep 12, 2024

same on windows 11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants