TikTok-Api icon indicating copy to clipboard operation
TikTok-Api copied to clipboard

RuntimeError: This event loop is already running is still an issue

Open franciscogmm opened this issue 2 years ago • 3 comments

~\anaconda3\lib\site-packages\TikTokApi\tiktok.py in _initialize(self, **kwargs)
    161 
    162         if self._signer_url is None:
--> 163             self._browser = asyncio.get_event_loop().run_until_complete(
    164                 asyncio.gather(browser.create(**kwargs))
    165             )[0]

This is where the issue happens.

Like others, I am just trying to get TiktokApi to initialize using with TikTokApi() as api:

franciscogmm avatar Jun 20 '22 15:06 franciscogmm

Same here

batmanscode avatar Jun 25 '22 00:06 batmanscode

OS? Are you using jupyter, etc?

davidteather avatar Jul 03 '22 23:07 davidteather

OS? Are you using jupyter, etc?

Jupyter notebook on Debian buster

batmanscode avatar Jul 06 '22 08:07 batmanscode

For jupyter, try adding

import nest_asyncio
nest_asyncio.apply()

soniaseguz avatar Oct 07 '22 17:10 soniaseguz

For jupyter, try adding

import nest_asyncio
nest_asyncio.apply()

Thanks! Will give this a try next time I use it

batmanscode avatar Oct 27 '22 16:10 batmanscode

V6 fully async

davidteather avatar Aug 08 '23 22:08 davidteather