我运行pip install streamlit
并成功安装了streamlit。
但是,当我运行streamlit hello
或我在streamlit run app.py
哪里运行app.py
python 应用程序时import streamlit
,我收到以下错误。
$ streamlit hello
Traceback (most recent call last):
File "c:\program files (x86)\python37-32\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\program files (x86)\python37-32\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Program Files (x86)\Python37-32\Scripts\streamlit.exe\__main__.py", line 7, in <module>
File "c:\program files (x86)\python37-32\lib\site-packages\click\core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "c:\program files (x86)\python37-32\lib\site-packages\click\core.py", line 717, in main
rv = self.invoke(ctx)
File "c:\program files (x86)\python37-32\lib\site-packages\click\core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\program files (x86)\python37-32\lib\site-packages\click\core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\program files (x86)\python37-32\lib\site-packages\click\core.py", line 555, in invoke
return callback(*args, **kwargs)
File "c:\program files (x86)\python37-32\lib\site-packages\streamlit\cli.py", line 192, in main_hello
_main_run(filename)
File "c:\program files (x86)\python37-32\lib\site-packages\streamlit\cli.py", line 251, in _main_run
bootstrap.run(file, command_line, args)
File "c:\program files (x86)\python37-32\lib\site-packages\streamlit\bootstrap.py", line 221, in run
server.start(_on_server_start)
File "c:\program files (x86)\python37-32\lib\site-packages\streamlit\server\Server.py", line 213, in start
start_listening(app)
File "c:\program files (x86)\python37-32\lib\site-packages\streamlit\server\Server.py", line 122, in start_listening
app.listen(port)
File "c:\program files (x86)\python37-32\lib\site-packages\tornado\web.py", line 2042, in listen
server.listen(port, address)
File "c:\program files (x86)\python37-32\lib\site-packages\tornado\tcpserver.py", line 143, in listen
sockets = bind_sockets(port, address=address)
File "c:\program files (x86)\python37-32\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
我试图禁用防火墙,但仍然出现错误。我也尝试过运行streamlit run app.py --browser.serverPort 3000
,但仍然遇到同样的错误。