原文链接:http://www.juzicode.com/archives/2167
错误提示:
在cmd窗口输入pip install xyz,提示:“ ‘pip’ 不是内部或外部命令,也不是可运行的程序或批处理文件。 ”
D:\juzicode>pip install 2to3
'pip' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

错误原因:
1、安装Python解释器时没有勾选添加path路径,下图是安装时的正确姿势:

解决方法:
1、找到Python的安装路径,假设Python安装路径在D:\Python\Python38\, 手动添加 D:\Python\Python38\Scripts到Path环境变量,windows系统下查找添加路径可参考 计算机基础–Windows PATH变量、命令行、搜索路径

添加路径后,打开一个新的cmd命令行:

2、找到python安装路径,pip在安装路径的Scripts目录下,直接在命令行输入pip可执行文件所在的完整路径进行安装,D:\Python\Python38\Scripts\pip install 2to3,回车运行:

相关阅读:
关注微信公众号:“桔子code”,欢迎后台留言撩我,我会尽我所能为你解惑Python,C等编程知识
