Closed UnseenVoid closed 1 year ago
same error. Saying that coroutine AsyncChatbot.create was never awaited
Looks like it is problem with the jupyter notebook.
executing !pip3 install tornado==4.5.3
and restarting the runtime solved the problem for me.
same error in different form
RuntimeError: Cannot run the event loop while another loop is running[0m 2023-06-22T14:07:40.583875899Z /usr/local/lib/python3.11/site-packages/discord/client.py:446: RuntimeWarning: coroutine 'AsyncChatbot.ask' was never awaited 2023-06-22T14:07:40.583907779Z await self.on_error(event_name, *args, **kwargs) 2023-06-22T14:07:40.583913761Z RuntimeWarning: Enable tracemalloc to get the object allocation traceback
same error
same error
I am using 1.2.0 its working fine u can use that version till they fix it
Breaks in Google Colab due to weird async handling.
import nest_asyncio
nest_asyncio.apply()
Duplicate of #52
Cell In[14], line 7 3 from Bard import Chatbot 5 token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ----> 7 chatbot = Chatbot(token) 9 chatbot.ask("Hello, how are you?")
File d:\async\env\lib\site-packages\Bard.py:63, in Chatbot.init(self, session_id, proxy, timeout) 56 def init( 57 self, 58 session_id: str, 59 proxy: dict = None, 60 timeout: int = 20, 61 ): 62 self.loop = asyncio.get_event_loop() ---> 63 self.async_chatbot = self.loop.run_until_complete( 64 AsyncChatbot.create(session_id, proxy, timeout), 65 )
File C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\asyncio\base_events.py:625, in BaseEventLoop.run_until_complete(self, future) 614 """Run until the Future is done. 615 616 If the argument is a coroutine, it is wrapped in a Task. (...) ... 585 if events._get_running_loop() is not None: 586 raise RuntimeError( 587 'Cannot run the event loop while another loop is running')
RuntimeError: This event loop is already running
How to Fix it?