成功解决:Can‘t find Python executable “python“, you can set the PYTHON env variable.
今天跑公司新项目的时候、运行前端vue、报了一个关于python的错误。就离谱
1、问题报错全部代码
actual version of core-js.
npm ERR! code 1
npm ERR! path E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/build.js
npm ERR! Building: E:\work\nodejs\node.exe E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli 'E:\\work\\nodejs\\node.exe',
npm ERR! gyp verb cli 'E:\\workspace\\bsi-web-develop\\bsi-web-develop\\node_modules\\node-gyp\\bin\\node-gyp.js',
npm ERR! gyp verb cli 'rebuild',
npm ERR! gyp verb cli '--verbose',
npm ERR! gyp verb cli '--libsass_ext=',
npm ERR! gyp verb cli '--libsass_cflags=',
npm ERR! gyp verb cli '--libsass_ldflags=',
npm ERR! gyp verb cli '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@16.13.1 | win32 | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "python2" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python2
npm ERR! gyp verb `which` failed at getNotFoundError (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed at F (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed at E (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed at E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed at E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed at E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp verb `which` failed python2 Error: not found: python2
npm ERR! gyp verb `which` failed at getNotFoundError (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed at F (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed at E (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed at E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed at E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed at E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21) {
npm ERR! gyp verb `which` failed code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb check python checking for Python executable "python" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python
npm ERR! gyp verb `which` failed at getNotFoundError (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed at F (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed at E (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed at E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed at E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed at E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp verb `which` failed python Error: not found: python
npm ERR! gyp verb `which` failed at getNotFoundError (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed at F (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed at E (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed at E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed at E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed at E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21) {
npm ERR! gyp verb `which` failed code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb could not find "python". checking python launcher
npm ERR! gyp verb could not find "python". 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 "python", you can set the PYTHON env variable.
npm ERR! gyp ERR! stack at PythonFinder.failNoPython (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\node-gyp\lib\configure.js:484:19)
npm ERR! gyp ERR! stack at PythonFinder.<anonymous> (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\node-gyp\lib\configure.js:509:16)
npm ERR! gyp ERR! stack at callback (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\graceful-fs\polyfills.js:299:20)
npm ERR! gyp ERR! stack at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp ERR! System Windows_NT 10.0.18363
npm ERR! gyp ERR! command "E:\\work\\nodejs\\node.exe" "E:\\workspace\\bsi-web-develop\\bsi-web-develop\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd E:\workspace\bsi-web-develop\bsi-web-develop\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! gyp ERR! not ok
npm ERR! Build failed with error code: 1
npm ERR! A complete log of this run can be found in:
npm ERR! E:\work\vue\nodejs\node_cache\_logs\2022-08-18T01_08_20_286Z-debug.log
2、问题核心部分
Can't find Python executable "python", you can set the PYTHON env variable.
npm ERR! gyp ERR! node -v v16.13.1
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
3、问题解决方法
首先面向百度编程
经过多次尝试自己成功解决这一问题的方法
3.1 安装编译环境(管理员身份运行)
npm install -g node-gyp
npm install --global --production windows-build-too
3.2 卸载安装失败的包
npm uninstall node-sass
3.3 重新安装包
npm install sass -i
3.3 重新 npm install
3.4 重新npm run dev
4、成功跑起来
成功解决:Can‘t find Python executable “python“, you can set the PYTHON env variable.的更多相关文章
- 成功解决在Python文件上右键菜单无“Edit with IDLE”选项
我电脑是Win7旗舰版,之前电脑上安装的是Python2.6版本的,前两天为了体验一下Microsoft Excel与Python之间互操作, 下载并安装了DataNitro,在安装的时候脑残的安装了 ...
- 解决Error: Can't find Python executable "python", you can set the PYTHON env variable
在执行 yarn start时遇到问题, 最后一行提示 Run `npm rebuild node-sass` to download the binding for your current env ...
- 成功解决gyp verb ensuring that file exists: C:\Python27\python.exe gyp ERR! configure error gyp ERR! sta
解决问题 gyp verb ensuring that file exists: C:\Python27\python.exegyp ERR! configure errorgyp ERR! stac ...
- Error: Can't find Python executable, you can set the PYTHON env variable.
该错误解决方案. NodeJS安装Npm包时出现错误: npm WARN prefer global node-gyp@3.4.0 should be installed with -g > s ...
- Spark-shell错误:Missing Python executable 'python', defaulting to ...
最近博主因为学习<云计算导论>一课,需要在Windows上搭建Saprk,故在网上找了相关教程搭建,步骤如下: 1. Scala 2.Spark 3.Handoop 但是不管博主怎么修正, ...
- Ubuntu18.0 解决python虚拟环境中不同用户下或者python多版本环境中指定虚拟环境的使用问题
一. 不同用户下配置virtualenvwrapper的问题 问题描述: 安装virtualnev和virtualnevwrapper之后,在.bashrc进行virtualenvwrapper的相关 ...
- Ubuntu16.04 下 python 3.6 安装以及各版本python切换(同时解决各种依赖缺失)
有些博客给出了从源代码通过./configure.make.sudo make 会导致安装玩之后出现各种依赖缺失的问题,如_sqlite3._bz2 等问题. 当然也有很多帖子给出了从系统自带的pyt ...
- 56.ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
Node.js 在安装模块的时候报错,缺少python环境. ERR! configure error gyp ERR! stack Error: Can't find Python executab ...
- 2022:checking for Python executable "python2" in the PATH
目录 一.node报错 说明 1.网上常用方法一(本博主环境无效) 2.网上常用方法二(本博主环境无效) 3.本博主使用方法(当前有效) 1.确保NodeJS环境安装没有问题,如果不会安装,请参考 构 ...
随机推荐
- React报错之Style prop value must be an object
正文从这开始~ 总览 在React中,当我们为元素的style 属性传递字符串时,会产生"Style prop value must be an object"警告.为了解决该警告 ...
- 不止跑路,拯救误操作rm -rf /*的小伙儿
摘要:误执行了 rm -rf /* 之后,除了跑路还能怎么办? 本文分享自华为云社区<拯救被 rm -rf 伤到的小伙>,作者:Gauss 松鼠会. 灵魂画师再次上线 在开饭前我们先了 ...
- ajax.readyState与ajax.status一览
ajax.readyState 0 -(未初始化)还没有调用send()方法 1 -(载入)已调用send()方法,正在发送请求 2 -(载入完成)send()方法执行完成,已经接收到全部响应内容 3 ...
- Excel 逻辑函数(二):AND 和 OR
前言 AND 函数是且:OR 函数是或.AND 函数中的条件必须都满足才返回 TRUE:OR 函数中的条件只要满足一个就返回 TRUE.AND 和 OR 的参数最多允许有 30 个. AND [题目] ...
- identity4 系列————纯js客户端案例篇[四]
前言 前面已经解释了两个案例了,通信原理其实已经很清楚了,那么纯js客户端是怎么处理的呢? 正文 直接贴例子哈. https://github.com/IdentityServer/IdentityS ...
- 【JDBC】学习路径9-dbcp数据源的使用
第一章:下载 要下载三个东西:commons pool.commons log.dbcp dbcp中有些东西是依赖于commons pool 和 commons log 的. 缺一不可,否则无法正确运 ...
- RT-Thread Studio增加软件包操作
RT-Thread Studio增加软件包操作 1. 在本地中完成如下操作 打开RTthread Studio的安装目录 在当前目录下找到env的目录 在env的目录下找到要添加软件包的分类文件夹 本 ...
- CDH6.2.0 搭建大数据集群
1. 资料准备 现在官网https://www.cloudera.com 需要注册账号,未来可能会收费等问题,十分麻烦,这里有一份我自己百度云的备份 链接: https://pan.baidu.com ...
- 基于 Gitea 服务端渲染的 Jupyter Notebooks
本指南将向您展示如何通过配置外部渲染器来使 Gitea 呈现 Jupyter Notebooks.当然,你还可以根据本指南来为你的 Gitea 实例配置其他类型的文档渲染器,甚至是二进制文件!相信Gi ...
- C++ 调用 Python(通过Boost.Python)
本文将用一个小的示例来展示如何通过Boost.Python 来实现 C++/Python 混合编程从而将两种语言的优势整合到一起. 1. CMakeLists.txt cmake_minimum_re ...