这是我第一次使用Streamlit,我已经使用它安装的
pip install streamlit
安装了sreamlit。尝试使用 streamlit run pop.py
运行 python 文件,它给了我以下错误:
C:\Users\DELL>streamlit run pop.py
Traceback (most recent call last):
File "c:\users\dell\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\dell\appdata\local\programs\python\python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python39\Scripts\streamlit.exe\__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'streamlit.cli'; 'streamlit' is not a package
您正在 Python 中使用它。打开cmd后不要写
python
。只需进入该文件夹并在cmd中输入streamlit run pop.py
即可。不在 Python 中。