I have created a script on jupyter for a streamlit application. Once I run it, I got the indications:
Warning: to view this Streamlit app on a browser, run it with the following
command:
streamlit run C:\Users\---\anaconda3\lib\site-packages\ipykernel_launcher.py [ARGUMENTS]
I run it as it says on the Anaconda terminal and the browser opens with an error. When I checked back the terminal, after the corresponding Local URL and Network URL address, it shows few more errors:
To connect another client to this kernel, use:
--existing kernel-10020.json
[IPKernelApp] ERROR | Unable to initialize signal:
Traceback (most recent call last):
File "C:\Users\---\anaconda3\lib\site-packages\ipykernel\kernelapp.py", line 674, in initialize
self.init_signal()
File "C:\Users\---\anaconda3\lib\site-packages\ipykernel\kernelapp.py", line 520, in init_signal
signal.signal(signal.SIGINT, signal.SIG_IGN)
File "C:\Users\---\anaconda3\lib\signal.py", line 56, in signal
handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
ValueError: signal only works in main thread of the main interpreter
2022-02-29 15:34:13.094 Uncaught app exception
Traceback (most recent call last):
File "C:\Users\---\anaconda3\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 565, in _run_script
exec(code, module.__dict__)
File "C:\Users\---\anaconda3\Lib\site-packages\ipykernel_launcher.py", line 17, in <module>
app.launch_new_instance()
File "C:\Users\---\anaconda3\lib\site-packages\traitlets\config\application.py", line 991, in launch_instance
app.initialize(argv)
File "C:\Users\---\anaconda3\lib\site-packages\traitlets\config\application.py", line 113, in inner
return method(app, *args, **kwargs)
File "C:\Users\---\anaconda3\lib\site-packages\ipykernel\kernelapp.py", line 680, in initialize
self.init_kernel()
File "C:\Users\---\anaconda3\lib\site-packages\ipykernel\kernelapp.py", line 524, in init_kernel
shell_stream = ZMQStream(self.shell_socket)
File "C:\Users\---\anaconda3\lib\site-packages\zmq\eventloop\zmqstream.py", line 106, in __init__
self.io_loop = io_loop or IOLoop.current()
File "C:\Users\---\anaconda3\lib\site-packages\zmq\eventloop\ioloop.py", line 127, in current
loop = ioloop.IOLoop.current(*args, **kwargs)
File "C:\Users\---\anaconda3\lib\site-packages\tornado\ioloop.py", line 263, in current
loop = asyncio.get_event_loop()
File "C:\Users\---\anaconda3\lib\asyncio\events.py", line 671, 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'.
2022-02-29 15:20:13.094 Uncaught app exception
Traceback (most recent call last):
File "C:\Users\---\anaconda3\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 565, in _run_script
exec(code, module.__dict__)
File "C:\Users\---\anaconda3\Lib\site-packages\ipykernel_launcher.py", line 17, in <module>
app.launch_new_instance()
File "C:\Users\---\anaconda3\lib\site-packages\traitlets\config\application.py", line 991, in launch_instance
app.initialize(argv)
File "C:\Users\---\anaconda3\lib\site-packages\traitlets\config\application.py", line 113, in inner
return method(app, *args, **kwargs)
File "C:\Users\---\anaconda3\lib\site-packages\ipykernel\kernelapp.py", line 665, in initialize
self.init_sockets()
File "C:\Users\---\anaconda3\lib\site-packages\ipykernel\kernelapp.py", line 303, in init_sockets
assert self.context is None, "init_sockets cannot be called twice!"
AssertionError: init_sockets cannot be called twice!
I have checked the app running "streamlit hello" and it works well. So, I do not know what is really going on.
Any suggestions please?
C:\Users\amith\LipNet\app
inside app folder i have my streamlit application streamlitapp.py
cd C:\Users\amith\LipNet\app
streamlit run streamlitapp.py
your streamlit app will be hosted locally on the default browser
i think you run script directly which will throw this indication:
if you run script directly in jupyter notebook it will throws error and warnings indication like this