发现在安装的时候有很多WARNING出现,但是没有但回事,现在回想起来问题就出在这里。
pip uninstall streamlit
当出现如下提示:
Would remove: c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\scripts\streamlit.cmd c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\scripts\streamlit.exe c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages\streamlit-1.20.0.dist-info\* c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages\streamlit\* Proceed (Y/n)?
请按“Y”并回车。
pip install streamlit
WARNING: Ignoring invalid distribution -yinstaller (c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages)
WARNING: Ignoring invalid distribution -yinstaller (c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages)
WARNING: Ignoring invalid distribution -yinstaller (c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages)
如何解决:
1)找到“C:\Users\administrator\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts”路径下。
2)将yinstaller和yinstaller-5.8.0.dist-info文件夹移动到其他路径。
重新再依次第一步和第二步。
WARNING: The script streamlit.exe is installed in 'C:\Users\administrator\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
原因为环境变量问题!需要修改环境变量。
修改环境变量重新启动后就可以了。