streamlit执行报错WARNING,重新安装碰到问题如何解决

streamlit执行报错WARNING,重新安装碰到问题如何解决

    • 如何解决
      • 1、卸载已经安装的程序
      • 2、再次安装程序
      • 3、出现如下yinstaller 警告问题:
      • 4、又出现“which is not on PATH”警告。
      • 5、解决方案

发现在安装的时候有很多WARNING出现,但是没有但回事,现在回想起来问题就出在这里。

如何解决

1、卸载已经安装的程序

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”并回车。

2、再次安装程序

pip install streamlit

3、出现如下yinstaller 警告问题:

 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文件夹移动到其他路径。

重新再依次第一步和第二步。

4、又出现“which is not on PATH”警告。

     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.

5、解决方案

原因为环境变量问题!需要修改环境变量。
修改环境变量重新启动后就可以了。
streamlit执行报错WARNING,重新安装碰到问题如何解决_第1张图片
streamlit执行报错WARNING,重新安装碰到问题如何解决_第2张图片
streamlit执行报错WARNING,重新安装碰到问题如何解决_第3张图片

你可能感兴趣的:(软件,Python,python,pip)