Win10 PATH环境变量被setx误改损坏 如何修复并添加Selenium路径
Win10修改PATH环境变量后Python命令失效问题
故障说明
- 曾执行命令
setx path "%path%;c:\directoryPath",尝试将Selenium相关内容加入系统PATH环境变量 - 命令执行结束后,原本可正常运行的
python、pip install ...等命令全部报错,报错原文为:
python : The term 'python' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
- 执行上述修改命令前,所有Python相关命令均可正常调用
- 初步排查发现,在PowerShell中执行
echo $PATH无任何路径输出,结果为空 - 附系统环境变量配置界面截图:

核心需求
- 如何修复、还原已被损坏的PATH环境变量
- 如何在Win10系统中正确将selenium.exe添加到PATH环境变量
内容的提问来源于stack exchange,提问作者peng Jack
相关产品推荐
相关产品推荐

