ffreemt / deepl-tr-async

deepl translate via pyppeteer
MIT License
11 stars 0 forks source link

your example python code fails #4

Open mathias3 opened 3 years ago

mathias3 commented 3 years ago

Your commands for terminal use work allright, but the code for python async fails

`import asyncio from deepl_tr_async import deepl_tr_async from deepl_tr_async.google_tr_async import google_tr_async

loop = asyncio.get_event_loop()

sent = 'Global coronavirus pandemic kills more than 30,000'

res = loop.run_until_complete(deepl_tr_async(sent, to_lang='zh')) print(res)`

returns

[I 210318 12:23:35 config:27] env_prefix: PPBROWSER_, env_file: /home/maciej/projects/translate_natura_q/translate-pptx/src/.env [I 210318 12:23:35 get_ppbrowser:34] HEADFUL: False [I 210318 12:23:35 get_ppbrowser:35] DEBUG: False [I 210318 12:23:35 get_ppbrowser:36] PROXY: [E 210318 12:23:35 get_ppbrowser:107] Unable to pyppeteer.launch exc: This event loop is already running [I 210318 12:23:35 get_ppbrowser:108] Possible cause: abnormal exit from a previous session. Try taskkill /f /im chrome.exe [W 210318 12:23:35 get_ppbrowser:112] Note that this will also kill your chrome browser. ERROR:root:Internal Python error in the inspect module. Below is the traceback from this internal error. ubuntu 18.04 Python 3.9.2 `