Can‘t find Python executable “c:\Python27\python.exe“, you can set the PYTHON env variable.

Can‘t find Python executable “c:\Python27\python.exe“, you can set the PYTHON env variable.

在使用npm安装软件的时候,报以下错误:

npm ERR! gyp verb could not find "c:\Python27\python.exe". checking python launcher
npm ERR! gyp verb could not find "c:\Python27\python.exe". guessing location
npm ERR! gyp verb ensuring that file exists: C:\Python27\python.exe
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Can't find Python executable "c:\Python27\python.exe", you can set the PYTHON env variable.
npm ERR! gyp ERR! stack     at PythonFinder.failNoPython (D:\study\x-touch\node_modules\node-gyp\lib\configure.js:484:19)
npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (D:\study\x-touch\node_modules\node-gyp\lib\configure.js:509:16)
npm ERR! gyp ERR! stack     at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp ERR! System Windows_NT 10.0.19043
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\study\\x-touch\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd D:\study\x-touch\node_modules\node-sass
npm ERR! gyp ERR! node -v v16.13.1
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! Build failed with error code: 1

Can’t find Python executable “c:\Python27\python.exe”, 主要错误时没有 python环境。

这个时候我们需要安装 Python27

我们就以安装 python 2.7 为例:

1.下载

下载需要的版本 : Python2.7下载
在这里插入图片描述

2.安装

傻瓜式安装 一直点下一步

3.配置

右击桌面上的“此电脑”—>“属性”—>“高级系统设置”—>右下角“环境变量”—>双击“系统变量”里的“Path”—>点击“新建”—>输入刚才的安装位置“C:\Python27;”,得到新建后的结果,然后一步步确定回去。

4.查看安装的版本

cmd
python
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值