此问题,自己分析了好久才找到问题。其实有两种解决方案,我这里举例了一个,另一种环境变量配置也是可以的。希望能帮到大家。

问题描述:

Error: Can‘t find Python executable “python“, you can set the PYTHON env var_解决方案


解决方案:

1:执行这条命令:

npm install --global --production windows-build-tools

执行后你会发现下面的截图所展示的问题,一定要仔细阅读(这两张截图);

Error: Can‘t find Python executable “python“, you can set the PYTHON env var_开发语言_02

 Error: Can‘t find Python executable “python“, you can set the PYTHON env var_解决方案_03


2:找到这个文件夹,点击进去

Error: Can‘t find Python executable “python“, you can set the PYTHON env var_开发语言_04


3:提醒一下,这里看截图操作

 Error: Can‘t find Python executable “python“, you can set the PYTHON env var_重新安装_05


4:先点击移除,完成后。再次找到python-2.7.15.amd64.msi 这个重新安装。

Error: Can‘t find Python executable “python“, you can set the PYTHON env var_后端_06

5:就用默认的这个盘,直接下一步,直到finish。

 Error: Can‘t find Python executable “python“, you can set the PYTHON env var_后端_07


6:再次回到你的执行命令的界面,先ctrl+c,再次执行命令:npm install

Error: Can‘t find Python executable “python“, you can set the PYTHON env var_后端_08

7:恭喜你

 Error: Can‘t find Python executable “python“, you can set the PYTHON env var_解决方案_09


8:执行命令 npm run dev