OSError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions

(stream) C:\Users\Ajinkya>streamlit hello
Traceback (most recent call last):
  File "c:\users\ajinkya\miniconda3\envs\stream\lib\runpy.py", line 192, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\ajinkya\miniconda3\envs\stream\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\Ajinkya\Miniconda3\envs\stream\Scripts\streamlit.exe\__main__.py", line 7, in <module>
  File "c:\users\ajinkya\miniconda3\envs\stream\lib\site-packages\click\core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "c:\users\ajinkya\miniconda3\envs\stream\lib\site-packages\click\core.py", line 717, in main
    rv = self.invoke(ctx)
  File "c:\users\ajinkya\miniconda3\envs\stream\lib\site-packages\click\core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\ajinkya\miniconda3\envs\stream\lib\site-packages\click\core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\ajinkya\miniconda3\envs\stream\lib\site-packages\click\core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "c:\users\ajinkya\miniconda3\envs\stream\lib\site-packages\streamlit\cli.py", line 193, in main_hello
    _main_run(filename)
  File "c:\users\ajinkya\miniconda3\envs\stream\lib\site-packages\streamlit\cli.py", line 251, in _main_run
    bootstrap.run(file, command_line, args)
  File "c:\users\ajinkya\miniconda3\envs\stream\lib\site-packages\streamlit\bootstrap.py", line 181, in run
    server.start(_on_server_start)
  File "c:\users\ajinkya\miniconda3\envs\stream\lib\site-packages\streamlit\server\Server.py", line 213, in start
    start_listening(app)
  File "c:\users\ajinkya\miniconda3\envs\stream\lib\site-packages\streamlit\server\Server.py", line 122, in start_listening
    app.listen(port)
  File "c:\users\ajinkya\miniconda3\envs\stream\lib\site-packages\tornado\web.py", line 2042, in listen
    server.listen(port, address)
  File "c:\users\ajinkya\miniconda3\envs\stream\lib\site-packages\tornado\tcpserver.py", line 143, in listen
    sockets = bind_sockets(port, address=address)
  File "c:\users\ajinkya\miniconda3\envs\stream\lib\site-packages\tornado\netutil.py", line 168, in bind_sockets
    sock.bind(sockaddr)
OSError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions

Hi @aidlml — and welcome to the forum! :wave:

I found similar issues that might help:

It looks like Windows (or some other software) is blocking socket access to the provided port.
Please let me know if the issue persists!

I tried all possible things but unable to use streamlit on windows machine. :slightly_frowning_face:

Hi @aidlml,

Can you say, specifically, what you’ve tried so far?

Faced the same issue and I was able to solve it by changing the default port:

streamlit run app_name.py --server.port 5998

on windows machine with

streamlit==0.65.1