Summary
I ran my code using anaconda and it actually opened the browser and just showed “please wait” and said " [TypeError: Protocols cannot be instantiated" . Then I updated my python from 3.9.7 to 3.9.12. And the browser showed “RuntimeError: There is no current event loop in thread ‘ScriptRunner.scriptThread’.”
Steps to reproduce
Code snippet:
#anaconda
2022-10-26 13:22:20.427 INFO numexpr.utils: Note: NumExpr detected 16 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8.
2022-10-26 13:22:20.427 INFO numexpr.utils: NumExpr defaulting to 8 threads.
2022-10-26 13:22:21.868
Warning: to view this Streamlit app on a browser, run it with the following
command:
streamlit run D:\Users\admin\anaconda3\envs\py34\lib\site-packages\ipykernel_launcher.py [ARGUMENTS]
#browser
RuntimeError: There is no current event loop in thread 'ScriptRunner.scriptThread'.
Traceback:
File "D:\Users\admin\anaconda3\envs\py34\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 562, in _run_script
exec(code, module.__dict__)
File "D:\Users\admin\anaconda3\envs\py34\Lib\site-packages\ipykernel_launcher.py", line 17, in <module>
app.launch_new_instance()
File "D:\Users\admin\anaconda3\envs\py34\lib\site-packages\traitlets\config\application.py", line 845, in launch_instance
app.initialize(argv)
File "D:\Users\admin\anaconda3\envs\py34\lib\site-packages\traitlets\config\application.py", line 88, in inner
return method(app, *args, **kwargs)
File "D:\Users\admin\anaconda3\envs\py34\lib\site-packages\ipykernel\kernelapp.py", line 681, in initialize
self.init_kernel()
File "D:\Users\admin\anaconda3\envs\py34\lib\site-packages\ipykernel\kernelapp.py", line 522, in init_kernel
shell_stream = ZMQStream(self.shell_socket)
File "D:\Users\admin\anaconda3\envs\py34\lib\site-packages\zmq\eventloop\zmqstream.py", line 106, in __init__
self.io_loop = io_loop or IOLoop.current()
File "D:\Users\admin\anaconda3\envs\py34\lib\site-packages\zmq\eventloop\ioloop.py", line 127, in current
loop = ioloop.IOLoop.current(*args, **kwargs)
File "D:\Users\admin\anaconda3\envs\py34\lib\site-packages\tornado\ioloop.py", line 263, in current
loop = asyncio.get_event_loop()
File "D:\Users\admin\anaconda3\envs\py34\lib\asyncio\events.py", line 642, in get_event_loop
raise RuntimeError('There is no current event loop in thread %r.'
Expected behavior:
Open and browser and show my app
Actual behavior:
Open the browser and throws a RuntimeError
Debug info
- Streamlit version: 1.13.0
- Python version: 3.9.12
- Using Conda
- Browser version: Chrome 106.0.5249.119