Windows Powershell & 环境变量;Powershell where命令无输出

为了安装百度PaddlePaddle的一些依赖,需要用pip安装一些包

1.发现环境变量里添加的Python明明是3.12,但是在cmd和Powershell中,python --version的输出结果却是3.11.5;

2.询问GPT,发现whereis命令在Windows下的对应为where,结果在powershell中输入where python,却发现没有输出,但是cmd内就有;

3-1.通过在cmd运行where python,发现原来是之前安装CHAT WITH RTX的时候,环境变量导入了其下的Miniconda目录,内部有Python可执行文件,版本为3.11.5且在环境变量中排序在Python312的上面,所以导致了上面的问题

3-2.powershell无输出的原因:powershell内部给Where-Object命令定义了别名where:

CommandType Name Version Source
----------- ---- ------- ------
Alias where -> Where-Object

所以需要输入where.exe才能运行那个我们需要的where命令

4.修改环境变量顺序后,问题解决。

posted @ 2024-07-27 02:16  Gold_stein  阅读(2)  评论(0编辑  收藏  举报