虚拟环境中直接使用虚拟path中的可执行文件(Scripts文件夹中),可能就会报这种错误,具体原因我也不清楚,可能是和系统path的冲突导致。

总结就四个字:卸载重装。

对于pip报错,解决方案:

python -m uninstall pip

卸载pip,然后

python -m ensurepip

重装pip,最后

python -m pip install --upgrade pip

即可

对于其他模块的报错,解决方案也是卸载重装。比如Fatal error in launcher: Unable to create process using ”...\scripts\python.exe” "...\scripts\streamlit.exe“报错,原因其实一般不在python,而是在streamlit,只需要

pip uninstall streamlit
pip install streamlit 

如果是python.exe出错,其他博客的解决方案是创建一个新的虚拟环境,然后把它的python.exe拉过来替换掉坏的(?)