尽管安装成功,术语 'pip' 仍未被识别为 windows 10 上的 cmdlet 的名称

The term 'pip' is not recognized as a name of a cmdlet on windows 10 despite successful installation

这里我查看安装的pip版本 py -m pip --version

pip 21.0.1 from C:\Users\hp\AppData\Local\Programs\Python\Python39\lib\site-packages\pip (python 3.9)

现在我尝试运行一个pip命令

pip install pip --target $HOME\.pyenv

pip: The term 'pip' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

将脚本文件夹添加到 PATH

C:\Users\hp\AppData\Local\Programs\Python\Python39\Scripts

C:\Python39\Scripts (取决于您的安装方式 python 找到并添加 python/scripts 文件夹)