.py imported streamlit module showing PermissionError

93 Views Asked by At

I was on my windows desktop trying to test with streamlit module by following the script "web.py":

import streamlit as st

st.title("My Todo App")

and in the terminal executing by:

streamlit run web.py

And then the error shows up:

  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\AppData\Local\Programs\Python\Python311\Scripts\streamlit.exe\__main__.py", line 7, in <module>
  File "C:\Users\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "C:\Users\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\AppData\Local\Programs\Python\Python311\Lib\site-packages\streamlit\web\cli.py", line 206, in main_run
    _main_run(target, args, flag_options=kwargs)
  File "C:\Users\AppData\Local\Programs\Python\Python311\Lib\site-packages\streamlit\web\cli.py", line 242, in _main_run
    bootstrap.run(file, command_line, args, flag_options)
  File "C:\Users\AppData\Local\Programs\Python\Python311\Lib\site-packages\streamlit\web\bootstrap.py", line 416, in run
    asyncio.run(run_server())
  File "C:\Users\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 190, in run
    return runner.run(main)
    start_listening_tcp_socket(http_server)
  File "C:\Users\AppData\Local\Programs\Python\Python311\Lib\site-packages\streamlit\web\server\server.py", line 140, in start_listening_tcp_socket
    http_server.listen(port, address)
  File "C:\Users\AppData\Local\Programs\Python\Python311\Lib\site-packages\tornado\tcpserver.py", line 183, in listen    sockets = bind_sockets(
              ^^^^^^^^^^^^^
  File "C:\Users\AppData\Local\Programs\Python\Python311\Lib\site-packages\tornado\netutil.py", line 162, in bind_sockets    sock.bind(sockaddr)
PermissionError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions

I have checked the windows Firewall Rules, nothing seems to blocking. Thank you for the helps!

expect streamlit script working.

0

There are 0 best solutions below