今天在运行streamlit 程序的时候出现了下面的问题:
raceback (most recent call last):
File "/usr/local/python3.7.0/lib/python3.7/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/local/python3.7.0/lib/python3.7/runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/local/python3.7.0/lib/python3.7/runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "/usr/local/python3.7.0/lib/python3.7/site-packages/streamlit/__init__.py", line 70, in <module>
from streamlit.delta_generator import DeltaGenerator as _DeltaGenerator
File "/usr/local/python3.7.0/lib/python3.7/site-packages/streamlit/delta_generator.py", line 168, in <module>
DataFrameSelectorMixin,
File "/usr/local/python3.7.0/lib/python3.7/site-packages/streamlit/delta_generator.py", line 303, in DeltaGenerator
def __getattr__(self, name: str) -> Callable[..., NoReturn]:
File "/usr/local/python3.7.0/lib/python3.7/typing.py", line 755, in __getitem__
return self.__getitem_inner__(params)
File "/usr/local/python3.7.0/lib/python3.7/typing.py", line 251, in inner
return func(*args, **kwds)
File "/usr/local/python3.7.0/lib/python3.7/typing.py", line 774, in __getitem_inner__
result = _type_check(result, msg)
File "/usr/local/python3.7.0/lib/python3.7/typing.py", line 135, in _type_check
raise TypeError(f"Plain {arg} is not valid as type argument")
TypeError: Plain typing.NoReturn is not valid as type argument
解决方法
可能3.7.0最新版不太支持,我们会退streamlit版本:
pip install streamlit==1.9