2022-03-27

importing from chessdotcom gives error as: RuntimeError: There is no current event loop in thread 'ScriptRunner.scriptThread'

import pandas as pd
import numpy as np

import streamlit as st

st.title("Chess Analysis")

from chessdotcom import get_player_profile

response = get_player_profile("fabianocaruana")

player_name = response.json['player']['name']

The error is :

 You can now view your Streamlit app in your browser.

  Local URL: http://localhost:8501
  Network URL: http://192.168.29.133:8501

2022-03-25 20:23:16.543 Traceback (most recent call last):
  File "C:\Users\sumit\anaconda3\envs\chess_engine\lib\site-packages\streamlit\scriptrunner\script_runner.py", line 443, in _run_script
    exec(code, module.__dict__)
  File "E:\Self Projects\ChessEngine\src\dashboard.py", line 8, in <module>
    from chessdotcom import get_player_profile
  File "C:\Users\sumit\anaconda3\envs\chess_engine\lib\site-packages\chessdotcom\__init__.py", line 2, in <module>
    from chessdotcom.client import *
  File "C:\Users\sumit\anaconda3\envs\chess_engine\lib\site-packages\chessdotcom\client.py", line 19, in <module>
    class Client:
  File "C:\Users\sumit\anaconda3\envs\chess_engine\lib\site-packages\chessdotcom\client.py", line 28, in Client
    loop = get_event_loop()
  File "C:\Users\sumit\anaconda3\envs\chess_engine\lib\asyncio\events.py", line 642, in get_event_loop
    raise RuntimeError('There is no current event loop in thread %r.'
RuntimeError: There is no current event loop in thread 'ScriptRunner.scriptThread'.

Any leads would be appreciated. Many thanks in advance!



No comments:

Post a Comment